I'm getting strange results from the Return.calculate() function in the
PerformanceAnalytics package:
I have a timeseries A with price data:

> A
                      AAPL.Close
2007-01-03      83.80
2007-01-04      85.66

The simple method of Return.calculate() gives me the following returns:

> Return.calculate(A, method="simple")
                   AAPL.Close
2007-01-03   -0.02171375
2007-01-04          NA

Isn' t that weird? I would expect a simple return on the 2007-01-04 row of:
(85.66 / 83.80) -1 = 0.02219570 and a NA value for the 2007-01-03 row.

The compound method of the function also gives a strange result:

> Return.calculate(A, method="compound")
                   AAPL.Close
2007-01-03         NA
2007-01-04   0.02195296

On the 2007-01-04 row I would expect the same return as the simple method
(because there is only one period): (85.66 / 83.80) -1 = 0.02219570
Instead it gives me 0.02195296.

Am I doing something wrong here or is the function broken?

Regards,

-Mark-

	[[alternative HTML version deleted]]

