Skip to content
Prev 275357 / 398503 Next

new to R coding.

Assuming that d(x) is equal to x, (I don't know a d() function in R)
these should be the same.

log(a/b) = log(a) - log(b) = diff(log(c(a,b))

If you mean simple returns instead of continuous/log returns, perhaps try this:

x[-1]/x[-length(x)] - 1

Michael
On Mon, Oct 24, 2011 at 11:44 AM, tynashy <tynashy at yahoo.co.uk> wrote: