[R-SIG-Finance] PerformanceAnalytics Return.calculate "simple" does not work

Brian G. Peterson brian at braverock.com
Thu Apr 12 23:41:21 CEST 2012


A regression bug slipped into the last release.
Fixed in svn r 1894

https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/PerformanceAnalytics/R/Return.calculate.R?root=returnanalytics

On Thu, 2012-04-12 at 14:19 -0700, Techni X wrote:
> 
> Dear,
> I encounter a problem if I run the example from the PerformanceAnalytics package on Return.calculate:
> require(tseries) prices = get.hist.quote("IBM", start = "1999-01-01", end = "2007-01-01", quote = "AdjClose", compression = "d") R.IBM = Return.calculate(prices, method="simple")
> 
> R.IBM is then a vector filled with zeros
> 
> Method="compound" however works:
> R.IBM = Return.calculate(prices, method="compound").
> 
> Still I do need the "simple" method. Can anybody help and give me a hint?
> 
> Thanks
> Stephan
> 
> > sessionInfo() R version 2.14.2 (2012-02-29)
> Platform: i386-pc-mingw32/i386 (32-bit) locale:
> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
> [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
> [5] LC_TIME=German_Germany.1252     attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base      other attached packages: [1] tseries_0.10-28              quadprog_1.5-4               [3] scales_0.2.0                 gdata_2.8.2                  [5] PerformanceAnalytics_1.0.4.4 ggplot2_0.9.0                [7] quantmod_0.3-17              TTR_0.21-1                   [9] xts_0.8-6                    zoo_1.7-7                   
> [11] Defaults_1.1-1               plyr_1.7.1                  
> [13] RColorBrewer_1.0-5           loaded via a namespace (and not attached): [1] colorspace_1.1-1 dichromat_1.2-4  digest_0.5.2     grid_2.14.2      [5] gtools_2.6.2     lattice_0.20-0   MASS_7.3-17      memoise_0.1      [9] munsell_0.3      proto_0.3-9.2    reshape2_1.2.1   stringr_0.6     
> [13] tools_2.14.2
> 
> _______________________________________________
> R-SIG-Finance at r-project.org 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.

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



More information about the R-SIG-Finance mailing list