I am curious how I revert from log-returns to prices. Here’s an example:
> a1 <- c(88.23, 88.44, 88.55, 88.77, 88.99)
> a1
[1] 88.23 88.44 88.55 88.77 88.99
> a2 <- diff(log(a1))
> a2
[1] 0.002377315 0.001243008 0.002481391 0.002475249
a1 is prices, a2 is returns. How would I go from a2 back to a1? Any suggestions would be great.
That should do: