[R-SIG-Finance] PerformanceAnalytics - small problem with Return.excess

Brian G. Peterson brian at braverock.com
Thu May 6 13:28:22 CEST 2010


A time series with only one element is not a 'series'.

In the case of excess returns, with only one return the excess return is the 
return of your asset minus the return of the risk free or benchmark asset over 
the same time period represented by your single number.

I'm not likely to spend time putting in a workaround, given that this is a 
pretty rare/edge case, and I've got other higher priorities right now.

However, we would certainly welcome a patch if you wanted to take a look at the 
code.

Regards,

     - Brian

Giuseppe Milicia wrote:
> Guys,
> 
> I've noticed a small problem in PerformanceAnalytics, Return.excess does not like timeseries with only 1 elements. Obviously this situation does not happen often, but getting around the issue is rather unelegant:
> 
> Loading required package: PerformanceAnalytics
> 
> Package PerformanceAnalytics (1.0.2.1) loaded.
> Econometric tools for performance and risk analysis.
> (c) 2004-2010 Peter Carl, Brian G. Peterson. License: GPL
> http://r-forge.r-project.org/projects/returnanalytics/
> 
> data(managers)
>> Return.excess(managers[1,1,drop=FALSE], 0)
> Error in `colnames<-`(`*tmp*`, value = "HAM1 > 0") :
>   attempt to set colnames on object with less than two dimensions
> 
> 
>> version
>                _
> platform       i386-pc-solaris2.10
> arch           i386
> os             solaris2.10
> system         i386, solaris2.10
> status
> major          2
> minor          10.1
> year           2009
> month          12
> day            14
> svn rev        50720
> language       R
> version.string R version 2.10.1 (2009-12-14)
> 
> Cheers,
> 
> //Giuseppe

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list