Compute log-returns in a time series.

조회 수: 14 (최근 30일)
User_asd User_asd
User_asd User_asd 2014년 10월 14일
답변: Roger Wohlwend 2014년 10월 14일
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

답변 (1개)

Roger Wohlwend
Roger Wohlwend 2014년 10월 14일
r = diff(log(S))

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by