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
PerformanceAnalytics: functions don't work after updating the package
2 messages · Alex Pramov, Gandhi, Puneet - RSCH AMRS
Alex, You have multiple options 1) Your previous installation is still working, you can keep using that 2) In your new installation of R, you don't need to update to latest version of performance analytics - Just copy the performance analytics folder from R 2.10 library folder to 2.11 library. This should resolve your problems for term paper. I prefer to use this method for all packages and then do packageStatus() and update.packages() . This asks which packages to update and I avoid packages critical to my code until I understand what changes have been made. 3) Figure out new version issue- I am unaware of these changes, so I will let someone else respond to that. Hope this helps. Puneet -----Original Message----- From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Alex Pramov Sent: Monday, August 30, 2010 5:16 AM To: r-sig-finance at stat.math.ethz.ch Subject: [R-SIG-Finance] PerformanceAnalytics: functions don't work afterupdating the package 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 _______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. ---------------------------------------------------------------------- This message w/attachments (message) is intended solely ...{{dropped:7}}