[GSoC-PortA] Factor Model Moment Estimates based on Boudt paper

Ross Bennett rossbennett34 at gmail.com
Sat May 31 06:05:38 CEST 2014


On Thu, May 29, 2014 at 9:16 AM, Brian G. Peterson <brian at braverock.com>
wrote:

> We should figure out a plan to put compiled higher moment functions into
> PerformanceAnalytics.
>

I'd be glad to do the legwork on this. As I mentioned in the previous
email, I have some prototype functions using RcppArmadillo based on the
fast R code with the more efficient algorithm that Josh sent me. I chose
RcppArmadillo because it is easy to use the matrix and vector classes from
Armadillo as well as the matrix operations. I suppose it would be feasible
to do this in fortran or C.

What are other's thoughts?

Are there any other functions in PerformanceAnalytics that you would like
to move to compiled code that might impact the decision?


>
> I'll leave it to you and Josh to figure out whether Rcpp or R's native
> .Call API make more sense.
>
Ok, I'll get the discussion going with Josh.


>
>   - Brian
>
>
>
> On 05/29/2014 11:13 AM, Ross Bennett wrote:
>
>> 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 <http://M3.MM> and M4.MM <http://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 <http://M3.MM> and M4.MM <http://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
>>
>>
>> _______________________________________________
>> GSoC-PortA mailing list
>> GSoC-PortA at lists.r-forge.r-project.org
>> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta
>>
>>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
> _______________________________________________
> GSoC-PortA mailing list
> GSoC-PortA at lists.r-forge.r-project.org
> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20140530/8fbeb557/attachment.html>


More information about the GSoC-PortA mailing list