Hi there,
not that the first value of the time series is 0.818908 and the second one is 0.355672. So that means that today is T=0.355672 and yesterday is Y=0.818908; assuming that yesterday is before today. That is why I said:
(0.355672 - .818908)/0.355672= -1.30242
If you want to get it the other way around you can simply use:
Differences[#]/Drop[#, -1] &@ts
(*{-0.565675, 0.958068, -0.437622, -0.837792, 10.4098, -0.233148, \
-0.66615, 2.1765, -0.187475, -0.207362, -0.800643, 3.16858, 1.83259, \
-0.187731, -0.814965, 0.57331, 2.31025, 0.0579287, 0.188419}*)
The first value of this gives the -56% change that you calculate.
Yes, Differences is a built-in function and it is usually a good idea to use them because they are more efficient. You can, however, program it yourself. There are many ways of achieving this:
Drop[#, 1] - Drop[#, -1] &@ts
or
Table[ts[[i + 1]] - ts[[i]], {i, 1, Length[ts] - 1}]
or
(ts - RotateRight[ts])[[2 ;;]]
or
Drop[ts - RotateRight[ts], 1]
or
Reap[Do[Sow[ts[[i + 1]] - ts[[i]]], {i, 1, Length[ts] - 1}]][[2, 1]]
or whatever you like.
Cheers,
M.