[R-SIG-Finance] PerformanceAnalytics: functions don't work after updating the package

Alex Pramov alexpramov at gmail.com
Mon Aug 30 11:15:43 CEST 2010


  Hi List,

I have the following problem with Performance Analytics:

In the last month I wrote code for a term paper, which used a lot of the 
functions in the package. Back then I used R 2.10.1 and the previous 
version of Performance Analytics ( I guess it was the previous version, 
as I've installed it for the first time in July). Everything worked fine.

Now I've updated my R and the package to the latest versions, and all 
the functions which need a benchmark won't work. I keep getting:

Fehler in Ra.excess[, column.a, drop = FALSE] :
   falsche Anzahl von Dimensionen

where falsche Anzahl von Dimensionen = wrong  number of dimensions.

I tried using timeSeries or zoo instead of xts but I keep getting the 
same problem. I changed the original data class from POSIXct to Date - 
that didn't work either. I tried with drop = FALSE, tried indexing the 
data as shown in this example from the package documentation:

table.HigherMoments(managers[,1:3],managers[,8,drop=FALSE])

but nothing helps.

Here is the structure of my data  and the function I'm trying to use:

 >  str(returns.xts)
An 'xts' object from 2009-11-18 to 2010-06-30 containing:
   Data: num [1:154, 1:6] -0.00182 -0.00293 -0.00147 0.00403 -0.00476 ...
  - attr(*, "dimnames")=List of 2
   ..$ : NULL
   ..$ : chr [1:6] "QAI" "MCRO" "ALT" "GRES" ...
   Indexed by objects of class: [Date] TZ:
   Original class: 'double'
   xts Attributes:
  NULL
 >

An 'xts' object from 2009-11-18 to 2010-06-30 containing:
   Data: num [1:154, 1] -0.0009 -0.0141 -0.004 0.013 -0.0013 0.0058 
-0.0185 0.0039 0.014 0.0023 ...
  - attr(*, "dimnames")=List of 2
   ..$ : NULL
   ..$ : chr "Market.Return"
   Indexed by objects of class: [Date] TZ:
   Original class: 'data.frame'
   xts Attributes:
  NULL

--------------------------------------------------------------------------------------
  table.HigherMoments(returns.xts,returns.market, Rf = 0)
--------------------------------------------------------------------------------------

What puzzles me is that the code worked perfectly fine before. I've 
looked in the change log but didnt find anything which can help me. 
Also, functions which don't need a benchmark work perfectly fine - f.ex 
table.Autocorrelation(returns.xts) has no problems.

Best Regards,

Alex



More information about the R-SIG-Finance mailing list