Skip to content
Prev 12917 / 15274 Next

Performance Analytics: table.CAPM

Thank you Joshua, 
Yes you are right I get also no error running the same code in a second attempt.

But the day after, I ran the same code and I got the same error message so I'm confused. 
In order to make the estimation work, I directly define the xts object in the formula as in the following

table.CAPM(as.xts(al[,1,drop=FALSE]),as.xts(al[,2,drop=FALSE]),Rf=as.xts(al[,3,drop=FALSE]))
where "al" is a multivariate xts class object. This is the only way I get it to work

while the day before, I didn't have any problem running more simply table.CAPM (p1,p2 ,p3) where p1,p2,p3 where previously defined as univariate xts object. 

There's something in these functions that seems to be sensitive to the way the "xts" is entered or specified. I noticed the problem occur more often when passing the xts in the risk free rate parameter "Rf".

I don't think it's critical as I found a way to overcome but a little less straightforward. 

Sorry for the code, I will try making it simpler next time
Regards, 

-----Original Message-----
From: Joshua Ulrich [mailto:josh.m.ulrich at gmail.com] 
Sent: Thursday, October 16, 2014 7:34 PM
To: Charles Duranceau
Cc: r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] Performance Analytics: table.CAPM

I get no errors when running your code with the most recent versions of xts and PerformanceAnalytics on CRAN.  Here's a simplified version of your example:

library(PerformanceAnalytics)
ind <- as.yearmon(Sys.Date())-(4:1)/12
Ra <- xts(c(0.1,0.11,0.09,0.1), ind)
Rb <- xts(c(0.25,0.2,-0.4,0.01), ind)
CAPM.alpha(Ra, Rb)
table.CAPM(Ra, Rb)

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
On Wed, Oct 15, 2014 at 4:28 PM, Charles Duranceau <cduranceau at nial.ky> wrote: