[R] problem with table.CAPM in PerformanceAnalytics

Pete Brecknock Peter.Brecknock at bp.com
Mon Jan 16 03:13:01 CET 2012


Dom Pazzula wrote
> 
> All,
> I'm attempting to run this:
> table.CAPM(series[,"Strat.Return",drop=FALSE],series[,"spy.Return",drop=FALSE])
> 
> 
> and getting this error
> Error in as.vector(data[, i]) : subscript out of bounds
> 
> 
> I've searched around and cannot find a solution to the problem.  I've used
> this in the past without problem and I'm not sure what I did different
> this time.
> 
> Other functions from that package like chat.CumReturns() work OK with this
> series.  CAPM.Beta() does not.
> 
> You can get the series timeSeries at
> http://www.pazzula.com/blog/series.rda
> 
> 
> Thanks in advance.
>  
> Dominic J. Pazzula
> +-+-+-+-+-+-+-+-+-+-+-
> dompazz@
> 	[[alternative HTML version deleted]]
> 
> 
> ______________________________________________
> R-help@ mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

Hi Dom

I notice that if I change your input series to an xts object things seem to
work ...

table.CAPM(as.xts(series[,"Strat.Return",drop=FALSE]),
as.xts(series[,"spy.Return",drop=FALSE]))

                    Strat.Return to spy.Return
Alpha                                   0.0013
Beta                                    0.1921
Beta+                                   0.6830
Beta-                                  -0.0803
R-squared                               0.0374
Annualized Alpha                        0.3990
Correlation                             0.1934
Correlation p-value                     0.0000
Tracking Error                          0.7447
Active Premium                          0.3694
Information Ratio                       0.4960
Treynor Ratio                           1.8885

HTH

Pete

--
View this message in context: http://r.789695.n4.nabble.com/problem-with-table-CAPM-in-PerformanceAnalytics-tp4298267p4298351.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list