[GSoC-PortA] Factor Model Moment Estimates based on Boudt paper
Ross Bennett
rossbennett34 at gmail.com
Thu May 29 18:13:09 CEST 2014
All,
Some parts of this were briefly discussed in a previous email thread, but I
want to get the discussion started again.
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.
Do we want to re-write using R's C API or should we include "as is" and use
Rcpp?
This raised another discussion about computing the higher moments. Right
now we use M3.MM and M4.MM 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.
What is the plan for M3.MM and M4.MM in PerformanceAnalytics?
This potentially has a big impact on PortfolioAnalytics since the moments
are computed at each rebalance period iteration.
See attached for a benchmark (Processor: 2.9 GHz Intel Core i7; Memory: 8
GB).
Let me know your thoughts and if you have any questions or comments.
Thanks,
Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20140529/6080af6e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmarkM3.png
Type: image/png
Size: 70614 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20140529/6080af6e/attachment-0001.png>
More information about the GSoC-PortA
mailing list