<div dir="ltr">All,<div><br></div><div>Some parts of this were briefly discussed in a previous email thread, but I want to get the discussion started again. </div><div><br></div><div>The code to compute the cokurtosis error matrix for multi factor and single factor models is written in C++ and uses the Rcpp package. The functions were sent to me by Kris Boudt and written by Joshua Ulrich. Joshua did state that the speed gains were very large and we do not want to write these in R.</div>
<div><br></div><div>Do we want to re-write using R's C API or should we include "as is" and use Rcpp?</div><div><br></div><div>This raised another discussion about computing the higher moments. Right now we use <a href="http://M3.MM">M3.MM</a> and <a href="http://M4.MM">M4.MM</a> from PerformanceAnalytics in set.portfolio.moments to compute the sample estimates. I re-wrote these using RcppArmadillo which was fairly straightforward because Armadillo has a function to compute the kronecker product. Joshua has profiled and optimized coskewness and cokurtosis functions written in R that are very fast. They use a different algorithm to avoid the kronecker product which results in a huge performance gain.</div>
<div><br></div><div>What is the plan for <a href="http://M3.MM">M3.MM</a> and <a href="http://M4.MM">M4.MM</a> in PerformanceAnalytics?</div><div><br></div><div>This potentially has a big impact on PortfolioAnalytics since the moments are computed at each rebalance period iteration.</div>
<div><br></div><div>See attached for a benchmark <span style="font-family:arial,sans-serif;font-size:13px">(Processor: 2.9 GHz Intel Core i7; Memory: 8 GB).</span></div><div><br></div><div>Let me know your thoughts and if you have any questions or comments.</div>
<div><br></div><div>Thanks,</div><div>Ross</div></div>