Skip to content

Return.calculate strange results?

2 messages · Mark Breman, Robert Iquiapaza

#
Mark

Using library(timeSeries)
returns(A, method = "discrete")
returns(A, method = "continuous")

or PerformanceAnalytics version 0.9.7.1

require(PerformanceAnalytics)
Return.calculate(z, method="simple")
               Column
2007-01-04 0.02219570
Return.calculate(z, method="compound")
               Column
2007-01-04 0.02195296

I got the same results.

The continuous or compound is computed with ln(85.66/83.8)

The error could be in the way you call the data. Also it appears that some 
packages have extrange behavior when you only have two observations.

This is the result with timeSeries
x
2007-01-04         NA        #lock the data
2007-01-04 0.02219570
x
2007-01-03         NA
           0.02195296     #no data

with tree observations gets better
x
2007-01-03          NA
2007-01-04  0.02195296
2007-01-05 -0.01363444


--------------------------------------------------
From: "Mark Breman" <breman.mark at gmail.com>
Sent: Friday, June 12, 2009 2:27 PM
To: <r-sig-finance at stat.math.ethz.ch>
Subject: [R-SIG-Finance] Return.calculate strange results?