[R-SIG-Finance] Performance Analytics: table.CAPM

Charles Duranceau cduranceau at nial.ky
Wed Oct 15 23:28:03 CEST 2014


Hi,
I noticed a problem with the function : table.CAPM when it return following error message: "Error in NextMethod(.Generic) : dims [product 4] do not match the length of object [0]"
I noticed in a previous post the solution is to transform series in xts, but in this case the series is already a xts object.
I don't understand as other similar functions works well as the following code shows

library("xts", lib.loc="C:/Users/cduranceau/Documents/R/win-library/3.1")
library("PerformanceAnalytics", lib.loc="C:/Users/cduranceau/Documents/R/win-library/3.1")
# Define Returns
pf1<-c(0.1,0.11,0.09,0.1)
bm<-c(0.25,0.2,-0.4,0.01)
time_index<-seq(as.Date("2003/05/01"), by = "month", length.out = 4)-1 # last day of the month
pf1x<-as.xts(pf1,time_index)
bmx<-as.xts(bm,time_index)


CAPM.alpha(pf1x, bmx, Rf = 0) # works [1] 0.09965609
table.CAPM(pf1x,bmx,Rf=0)    # error

Is there a way to solve the issue?
Thank you

Best Regards,


Version info

platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status
major          3
minor          1.0
year           2014
month          04
day            10
svn rev        65387
language       R
version.string R version 3.1.0 (2014-04-10)
nickname       Spring Dance


package:

Package:

 "PerformanceAnalytics" VERSION 1.4.3541 from CRAN   ---- project.org/bin/windows/contrib/3.1/PerformanceAnalytics_1.4.3541.zip

Charles


**********************************************************************************************************************************************************
The contents of this email and any attachments are confidential to the intended recipient.  They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient.  If this email is received in error, please contact Northview Investment Advisors Ltd. on + 1 345 943 2828 quoting the name of the sender and the email address to which it has been sent and then delete it.

Please further note that neither Northview Investment Advisors Ltd. nor the sender accepts any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments.

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list