Compute log-returns in a time series.

17 views (last 30 days)
User_asd User_asd
User_asd User_asd on 14 Oct 2014
Answered: Roger Wohlwend on 14 Oct 2014
Dear users, I have a doubt with this operation. i need to compute a log-returns of a time-series, accourding to the formula (continuously compounded return):
r(t)=log[S(t)]-log[S(t-1)]
In other terms, i have a vector of prices, and i want to have a vector of log-return.
How to compute in Matlab?
Thanks in advance

Answers (1)

Roger Wohlwend
Roger Wohlwend on 14 Oct 2014
r = diff(log(S))

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!