<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1504119207016_351151"><span>Good morning all,</span></div><div id="yui_3_16_0_ym19_1_1504119207016_351151"><span><br></span></div><div id="yui_3_16_0_ym19_1_1504119207016_351151" dir="ltr"><span id="yui_3_16_0_ym19_1_1504119207016_351297">I agree with the prior message on all counts but I am also a big fan of SIT package.</span></div><div id="yui_3_16_0_ym19_1_1504119207016_351151" dir="ltr">Here are the steps to install SIT, with the repo <b id="yui_3_16_0_ym19_1_1504119207016_351755">sit</b> file (248 KB) attached below.</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1504119207016_351150"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1504119207016_351150"><div id="yui_3_16_0_ym19_1_1504119207016_351249"># https://github.com/systematicinvestor/SIT<br></div><div id="yui_3_16_0_ym19_1_1504119207016_351251">install.packages('C:/Dropbox/QUANTstudio/R/<b>sit</b>', repos = NULL, type='source')</div><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_351252"><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_353046">?`SIT-package`</div><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_353047"><br id="yui_3_16_0_ym19_1_1504119207016_353048"></div></div><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_351252">Regards,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_351252">Darius</div><div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_351252"><br></div><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1504119207016_351146" style="display: block;">  <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1504119207016_351145"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1504119207016_351144"> <div dir="ltr" id="yui_3_16_0_ym19_1_1504119207016_351143"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1504119207016_351142"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Ross Bennett <rossbennett34@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> "r-sig-finance@r-project.org" <r-sig-finance@r-project.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, September 8, 2017 6:56 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [R-SIG-Finance]     Some problems while reading Diethelm Würtz's Portfolio Optimization with R book<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1504119207016_351298"><br>Although the last release to CRAN was in 2015 for PortfolioAnalytics, it is<br clear="none">still in active use and we are committed to maintaining it. In my opinion,<br clear="none">PortfolioAnalytics is the goto package for portfolio optimization... I am a<br clear="none">coauthor of the package so my opinion is biased.<br clear="none"><br clear="none">For a backtesting package, I highly recommend quantstrat. It was built by<br clear="none">and is used by professional traders. The demos are a good place to start<br clear="none">for learning how to use the package.<br clear="none"><br clear="none">Regards,<br clear="none"><br clear="none">Ross<br clear="none"><br clear="none">On Fri, Sep 8, 2017 at 5:27 AM, <<a shape="rect" ymailto="mailto:Oliver.J.Herrmann@gmx.de" href="mailto:Oliver.J.Herrmann@gmx.de">Oliver.J.Herrmann@gmx.de</a>> wrote:<br clear="none"><br clear="none">> Two or three follow up questions to your reply:<br clear="none">><br clear="none">> 1.  package PortfolioAnalytics date is 2015, so does not seem to have been<br clear="none">> updated for a while too. But still the package to go for optimization?<br clear="none">> 2. I am currently looking for a good package for backtesting strategies. I<br clear="none">> am still working through the recommended packages from the list in view<br clear="none">> "empirical finance" (excellent overview btw). Which package(s) would you<br clear="none">> recommend for backtesting?<br clear="none">><br clear="none">> My (prelimenary) assessment of<br clear="none">><br clear="none">> 1. package "backtest": not to be used because not many functions, only<br clear="none">> basics of backtesting are covered.<br clear="none">><br clear="none">> 2. package: "STI" : not to be used because difficult to install, almost no<br clear="none">> documentation, last update in 2012<br clear="none">><br clear="none">> 3. package: "TTR" : very useful!<br clear="none">><br clear="none">> 4. package: "quantstrat" : very useful<br clear="none">><br clear="none">><br clear="none">> Any experience and/or evaluation of the following packages (that I still<br clear="none">> have on my work through list) would be highly appreciated:<br clear="none">><br clear="none">> package: "portfolioSim"<br clear="none">> package: "pbo"<br clear="none">> package: "portfolio":<br clear="none">> package: "factorAnalytics"<br clear="none">><br clear="none">><br clear="none">> It seems to me that "quantstrat" is the package to go for. However,<br clear="none">> documentation is sparse and spread around various sites. Any suggestions<br clear="none">> for additional sources (outside Guy Yollin) are welcome too.<br clear="none">><br clear="none">> Cheers,<br clear="none">> Oliver<br clear="none">><br clear="none">> *Gesendet:* Sonntag, 27. August 2017 um 15:41 Uhr<br clear="none">> *Von:* "Brian G. Peterson" <<a shape="rect" ymailto="mailto:brian@braverock.com" href="mailto:brian@braverock.com">brian@braverock.com</a>><br clear="none">> *An:* <a shape="rect" ymailto="mailto:r-sig-finance@r-project.org" href="mailto:r-sig-finance@r-project.org">r-sig-finance@r-project.org</a><br clear="none">> *Betreff:* Re: [R-SIG-Finance] Some problems while reading Diethelm<br clear="none">> Würtz's Portfolio Optimization with R book<br clear="none">> Regrettably, Diethelm died in a car accident last year. He is missed by<br clear="none">> many in this community who appreciated his advice, openness, and<br clear="none">> fostering of the community.<br clear="none">><br clear="none">> fPortfolio has not been updated for some time. I would suggest looking<br clear="none">> at Berhard Pfaff's excellent risk and portfolio management book, as well<br clear="none">> as at packages such as PortfolioAnalytics for actually doing portfolio<br clear="none">> optimization in R.<br clear="none">><br clear="none">> I still refer to Diethelm's book for ideas and visualizations, but I do<br clear="none">> not use that code.<br clear="none">><br clear="none">> Regards,<br clear="none">><br clear="none">> Brian<br clear="none">><br clear="none">> On 08/27/2017 08:35 AM, Baki UNAL via R-SIG-Finance wrote:<br clear="none">> > Hello<br clear="none">> > I am reading Diethelm Würtz's Portfolio Optimization with R book. I<br clear="none">> encountered a problem at "17.2 How to Compute a Minimum Risk Efficient<br clear="none">> Portfolio" part. I entered the commands:<br clear="none">> ><br clear="none">> >> minriskSpec <- portfolioSpec()> targetReturn <-<br clear="none">> getTargetReturn(<a shape="rect" ymailto="mailto:ewPortfolio@portfolio" href="mailto:ewPortfolio@portfolio">ewPortfolio@portfolio</a>)["mean"]><br clear="none">> setTargetReturn(minriskSpec) <- targetReturn<br clear="none">> >> minriskPortfolio <- efficientPortfolio(data = lppData,spec =<br clear="none">> minriskSpec,constraints = "LongOnly")> print(minriskPortfolio)<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > But I got the following output:<br clear="none">> ><br clear="none">> ><br clear="none">> > Title: MV Efficient Portfolio Estimator: covEstimator Solver:<br clear="none">> solveRquadprog Optimize: minRisk Constraints: LongOnly<br clear="none">> > Portfolio Weights:SBI SPI SII LMI MPI ALT 0 0 0 0 0 0<br clear="none">> > Covariance Risk Budgets:SBI SPI SII LMI MPI ALT<br clear="none">> > Target Returns and Risks:mean Cov CVaR VaR 0 0 0 0<br clear="none">> > Description: Sun Aug 27 16:00:42 2017 by user: win7120<br clear="none">> ><br clear="none">> > As you notice R does not compute Portfolio Weights, Target Returns and<br clear="none">> Risks... etc.<br clear="none">> > I also tried to run the code at "17.3 How to Compute the Global Minimum<br clear="none">> Variance Portfolio" which is:<br clear="none">> ><br clear="none">> >> globminSpec <- portfolioSpec()> globminPortfolio <-<br clear="none">> minvariancePortfolio(data = lppData,spec = globminSpec,constraints =<br clear="none">> "LongOnly")> print(globminPortfolio)<br clear="none">> ><br clear="none">> > But I got the following output:<br clear="none">> ><br clear="none">> > Title:<br clear="none">> > MV Minimum Variance Portfolio<br clear="none">> > Estimator: covEstimator<br clear="none">> > Solver: solveRquadprog<br clear="none">> > Optimize: minRisk<br clear="none">> > Constraints: LongOnly<br clear="none">> ><br clear="none">> > Portfolio Weights:<br clear="none">> > SBI SPI SII LMI MPI ALT<br clear="none">> > 0 0 0 0 0 0<br clear="none">> ><br clear="none">> > Covariance Risk Budgets:<br clear="none">> > SBI SPI SII LMI MPI ALT<br clear="none">> ><br clear="none">> ><br clear="none">> > Target Returns and Risks:<br clear="none">> > mean Cov CVaR VaR<br clear="none">> > 0 0 0 0<br clear="none">> ><br clear="none">> > Description:<br clear="none">> > Sun Aug 27 16:12:21 2017 by user: win7120<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > As you see R does not make computations again.<br clear="none">> ><br clear="none">> > I also tried to run the code at "17.4 How to Compute the Tangency<br clear="none">> Portfolio" which is:<br clear="none">> ><br clear="none">> >> tgSpec <- portfolioSpec()> setRiskFreeRate(tgSpec) <- 0<br clear="none">> ><br clear="none">> >> tgPortfolio <- tangencyPortfolio(data = lppData,spec =<br clear="none">> tgSpec,constraints = "LongOnly")<br clear="none">> ><br clear="none">> > This time I got the following error:<br clear="none">> ><br clear="none">> ><br clear="none">> > Error in if (STATUS != 0) { : argument is of length zero<br clear="none">> ><br clear="none">> > What may be the problem? Could you help?<br clear="none">> > Thanks<br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> ><br clear="none">> > [[alternative HTML version deleted]]<br clear="none">> ><br clear="none">> > _______________________________________________<br clear="none">> > <a shape="rect" ymailto="mailto:R-SIG-Finance@r-project.org" href="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br clear="none">> > <a shape="rect" href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br clear="none">> > -- Subscriber-posting only. If you want to post, subscribe first.<br clear="none">> > -- Also note that this is not the r-help list where general R questions<br clear="none">> should go.<br clear="none">> ><br clear="none">><br clear="none">><br clear="none">> --<br clear="none">> Brian G. Peterson<br clear="none">> <a shape="rect" href="http://braverock.com/brian/" target="_blank">http://braverock.com/brian/</a><br clear="none">> Ph: 773-459-4973 <(773)%20459-4973><br clear="none">> IM: bgpbraverock<br clear="none">><br clear="none">> _______________________________________________<br clear="none">> <a shape="rect" ymailto="mailto:R-SIG-Finance@r-project.org" href="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br clear="none">> <a shape="rect" href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br clear="none">> -- Subscriber-posting only. If you want to post, subscribe first.<br clear="none">> -- Also note that this is not the r-help list where general R questions<br clear="none">> should go.<br clear="none">><br clear="none">> _______________________________________________<br clear="none">> <a shape="rect" ymailto="mailto:R-SIG-Finance@r-project.org" href="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br clear="none">> <a shape="rect" href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank" id="yui_3_16_0_ym19_1_1504119207016_351418">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br clear="none">> -- Subscriber-posting only. If you want to post, subscribe first.<br clear="none">> -- Also note that this is not the r-help list where general R questions<br clear="none">> should go.<div class="yqt4870529229" id="yqtfd35512"><br clear="none">><br clear="none"><br clear="none">    [[alternative HTML version deleted]]<br clear="none"><br clear="none">_______________________________________________<br clear="none"><a shape="rect" ymailto="mailto:R-SIG-Finance@r-project.org" href="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br clear="none"><a shape="rect" href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br clear="none">-- Subscriber-posting only. If you want to post, subscribe first.<br clear="none">-- Also note that this is not the r-help list where general R questions should go.</div><br><br></div> </div> </div>  </div></div></body></html>