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

Techni X fibosworld at yahoo.com
Thu Apr 12 23:19:44 CEST 2012



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



More information about the R-SIG-Finance mailing list