<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-5815834906618132494.post7146931820585067167..comments</id><updated>2011-12-10T09:37:45.615-06:00</updated><category term='xts'/><category term='Code'/><category term='Interactive Brokers'/><category term='Drawdown'/><category term='LSPM'/><category term='quantmod'/><category term='Data'/><category term='Releases'/><category term='HIstorical Data'/><category term='blotter'/><category term='quantstrat'/><category term='Events'/><category term='TTR'/><category term='API'/><category term='IBrokers'/><category term='Examples'/><category term='R'/><category term='Excel'/><title type='text'>Comments on FOSS Trading: LSPM Examples</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.fosstrading.com/feeds/7146931820585067167/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html'/><author><name>Joshua Ulrich</name><uri>https://profiles.google.com/101580259945483587604</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-cNBfNQ-0tKE/AAAAAAAAAAI/AAAAAAAAAAA/QxKaQjp1h4M/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-3433174741609988951</id><published>2011-12-10T09:37:45.615-06:00</published><updated>2011-12-10T09:37:45.615-06:00</updated><title type='text'>Hi Grant,

I don&amp;#39;t currently know to accomplis...</title><content type='html'>Hi Grant,&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t currently know to accomplish your second request.  Stopping the optimization requires you interrupt the code.  There&amp;#39;s probably a way to catch the interrupt and return the current iteration&amp;#39;s &lt;i&gt;f&lt;/i&gt; values to the caller, but I&amp;#39;m not sure how to do it.&lt;br /&gt;&lt;br /&gt;That said, you can set &lt;b&gt;DEoptim.control$trace=TRUE&lt;/b&gt;, manually copy/paste the last iteration&amp;#39;s &lt;i&gt;f&lt;/i&gt; values prior to interrupt, then manually restart the job like you do to solve your first request.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/3433174741609988951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/3433174741609988951'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html?showComment=1323531465615#c3433174741609988951' title=''/><author><name>Joshua Ulrich</name><uri>http://www.blogger.com/profile/16641971932645230429</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-cNBfNQ-0tKE/AAAAAAAAAAI/AAAAAAAAAAA/QxKaQjp1h4M/s512-c/photo.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2010/01/lspm-examples.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-7146931820585067167' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/7146931820585067167' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1996417509'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-2515742035615023960</id><published>2011-12-02T04:46:18.556-06:00</published><updated>2011-12-02T04:46:18.556-06:00</updated><title type='text'>I created a more elegant solution to (1):

       ...</title><content type='html'>I created a more elegant solution to (1):&lt;br /&gt;&lt;br /&gt;        f &amp;lt;- read.csv(&amp;quot;OUTPUT [f].csv&amp;quot;, header=TRUE, as.is=TRUE, sep=&amp;quot;,&amp;quot;, dec=&amp;quot;.&amp;quot;)&lt;br /&gt;        for(i in 1:N){initialpop[(i-1)*NP+1] &amp;lt;- f$x[i]}&lt;br /&gt;&lt;br /&gt;I am still however wondering how to achieve (2):&lt;br /&gt;&lt;br /&gt;2. The ability to stop a search that is in process yet retain the current f values for use.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/2515742035615023960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/2515742035615023960'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html?showComment=1322822778556#c2515742035615023960' title=''/><author><name>TradingPro</name><uri>http://www.blogger.com/profile/01987456606418594625</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14625847397495846268'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-dtBln0L0CpM/Tiwc7JyfIyI/AAAAAAAAANY/aP6wWDzTOwA/s220/Aiki%2BRei.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2010/01/lspm-examples.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-7146931820585067167' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/7146931820585067167' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1029791792'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-555351768038881141</id><published>2011-12-02T01:15:31.393-06:00</published><updated>2011-12-02T01:15:31.393-06:00</updated><title type='text'>Josh,

I am looking to accomplish two things with ...</title><content type='html'>Josh,&lt;br /&gt;&lt;br /&gt;I am looking to accomplish two things with your R implementation of LSPM:&lt;br /&gt;&lt;br /&gt;1. The ability to pickup the f values from a previous search and then continue the search with those values.&lt;br /&gt;&lt;br /&gt;2. The ability to stop a search that is in process yet retain the current f values for use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have managed to accomplish the former with some rather inefficient code (coding is not my strong point) yet am at a loss as to how one could accomplish the latter:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I accomplish the former by writing the f values to file at the end of a run:&lt;br /&gt;&lt;br /&gt;write.csv(results$f, file=&amp;quot;OUTPUT [f].csv&amp;quot;)&lt;br /&gt;&lt;br /&gt;and then pick them up again prior to the next run by repopulating the initialpop with the following (here N=47):&lt;br /&gt;&lt;br /&gt;f &amp;lt;- read.csv(&amp;quot;OUTPUT [f].csv&amp;quot;, header=TRUE, as.is=TRUE, sep=&amp;quot;,&amp;quot;, dec=&amp;quot;.&amp;quot;)&lt;br /&gt;initialpop=cbind(rep(f$x[1],NP),rep(f$x[2],NP),rep(f$x[3],NP),rep(f$x[4],NP),rep(f$x[5],NP),rep(f$x[6],NP),rep(f$x[7],NP),rep(f$x[8],NP),rep(f$x[9],NP),rep(f$x[10],NP),&lt;br /&gt;rep(f$x[11],NP),rep(f$x[12],NP),rep(f$x[13],NP),rep(f$x[14],NP),rep(f$x[15],NP),rep(f$x[16],NP),rep(f$x[17],NP),rep(f$x[18],NP),rep(f$x[19],NP),rep(f$x[20],NP),&lt;br /&gt;rep(f$x[21],NP),rep(f$x[22],NP),rep(f$x[23],NP),rep(f$x[24],NP),rep(f$x[25],NP),rep(f$x[26],NP),rep(f$x[27],NP),rep(f$x[28],NP),rep(f$x[29],NP),rep(f$x[30],NP),&lt;br /&gt;rep(f$x[31],NP),rep(f$x[32],NP),rep(f$x[33],NP),rep(f$x[34],NP),rep(f$x[35],NP),rep(f$x[36],NP),rep(f$x[37],NP),rep(f$x[38],NP),rep(f$x[39],NP),rep(f$x[40],NP),&lt;br /&gt;rep(f$x[41],NP),rep(f$x[42],NP),rep(f$x[43],NP),rep(f$x[44],NP),rep(f$x[45],NP),rep(f$x[46],NP),rep(f$x[47],NP))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;However would you know how I could accomplish stoping a process that is running yet retain the f values so that they could be used or the process can be restarted again at a latter time if required?&lt;br /&gt;&lt;br /&gt;Grant</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/555351768038881141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/555351768038881141'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html?showComment=1322810131393#c555351768038881141' title=''/><author><name>TradingPro</name><uri>http://www.blogger.com/profile/01987456606418594625</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14625847397495846268'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/-dtBln0L0CpM/Tiwc7JyfIyI/AAAAAAAAANY/aP6wWDzTOwA/s220/Aiki%2BRei.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2010/01/lspm-examples.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-7146931820585067167' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/7146931820585067167' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1029791792'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-7097579881288251829</id><published>2011-11-15T18:23:20.541-06:00</published><updated>2011-11-15T18:23:20.541-06:00</updated><title type='text'>Hi Chris,

I mention that in the post; in the last...</title><content type='html'>Hi Chris,&lt;br /&gt;&lt;br /&gt;I mention that in the post; in the last paragraph of text before the code.  In short, the optimization algorithms are different and the algorithm in my post is able to find a set of &lt;i&gt;f&lt;/i&gt; values that produce a higher GHPR.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/7097579881288251829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/7097579881288251829'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html?showComment=1321403000541#c7097579881288251829' title=''/><author><name>Joshua Ulrich</name><uri>http://www.blogger.com/profile/16641971932645230429</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2010/01/lspm-examples.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-7146931820585067167' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/7146931820585067167' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1996417509'/></entry><entry><id>tag:blogger.com,1999:blog-5815834906618132494.post-6595826397362307645</id><published>2011-11-15T14:19:05.487-06:00</published><updated>2011-11-15T14:19:05.487-06:00</updated><title type='text'>Hi Josh

I am trying to replicate the results on p...</title><content type='html'>Hi Josh&lt;br /&gt;&lt;br /&gt;I am trying to replicate the results on page 87 (as mentioned in your post above) of the LSPM book. I do the following:&lt;br /&gt;&amp;gt; data(port)&lt;br /&gt;&amp;gt; DEctrl &amp;lt;- list(NP=30, itermax=100)&lt;br /&gt;&amp;gt; res &amp;lt;- optimalf(port, control=DEctrl)&lt;br /&gt;&lt;br /&gt;The result is :&lt;br /&gt;&lt;br /&gt;Iteration: 100 bestvalit: -1.293917 bestmemit:    1.000000    0.000000    0.857813&lt;br /&gt;&lt;br /&gt;Page 87 reads:&lt;br /&gt;MktSysA 0.307&lt;br /&gt;MktSysB 0&lt;br /&gt;MktSysC 0.693</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/6595826397362307645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5815834906618132494/7146931820585067167/comments/default/6595826397362307645'/><link rel='alternate' type='text/html' href='http://blog.fosstrading.com/2010/01/lspm-examples.html?showComment=1321388345487#c6595826397362307645' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/01276455562887525056</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.fosstrading.com/2010/01/lspm-examples.html' ref='tag:blogger.com,1999:blog-5815834906618132494.post-7146931820585067167' source='http://www.blogger.com/feeds/5815834906618132494/posts/default/7146931820585067167' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1911595344'/></entry></feed>
