Filter löschen
Filter löschen

cumulative geometric average returns

2 Ansichten (letzte 30 Tage)
Asanka Subasinghe
Asanka Subasinghe am 8 Jun. 2020
Kommentiert: KSSV am 8 Jun. 2020
I have a range of returns for a certain number of days. I'm wondering how I could calculate the cumulative geometric average returns.
Eg. day 1 return =5 % day 2 return =-1% day 3 return =4
so the cumulative geometric average return for day one would be (1+0.05)^(1/1)-1
For day 2 it would be ((1+0.05)*(1+0.99))^(1/2)-1
and for day 3 it would be ((1+0.05)*(1+0.99)*(1+0.04))^(1/3)-1
Rg=((1+R1)*(1+R2)*(1+R3)...(1+Rn))^(1/n)-1
I am unsure about the logic needed for the accumulation because I am multiplying the returns together rather than adding
where I could do something like sum=sum+return to find an average for example.

Antworten (1)

KSSV
KSSV am 8 Jun. 2020
Bearbeitet: KSSV am 8 Jun. 2020
Let R be your array of size 1*n.
iwant = cumprod(1+R).^(1./(1:n))-1
  4 Kommentare
Asanka Subasinghe
Asanka Subasinghe am 8 Jun. 2020
Thank you!
KSSV
KSSV am 8 Jun. 2020
Thanks ia accepting the answer.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 3-D Scene Control finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by