Hi, i need to calculate the geometric mean of financial returns (for a Markowtiz example), but obviously it won't work cause my data contains negative numbers. How can i do? Is there another function or i have to do it manually? Thanks

 채택된 답변

dpb
dpb 2020년 1월 22일

1 개 추천

Use
GR=100*(prod(1+R/100)^(1/numel(R))-1);
where R is the rate of return for the period.
Example:
>> R=[9 1 2 3 -1]; % sample rate of returns, %
>> GR=100*(prod(1+R/100)^(1/numel(R))-1) % geometric rate of return
GR =
2.7458

댓글 수: 3

thanks man that's how i've done it, but could this method return some type of error? or the result is legit?
dpb
dpb 2020년 1월 23일
편집: dpb 2020년 1월 23일
That's the definition for economic returns..."you can look it up" :)
perfect, thanks again

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Portfolio Optimization and Asset Allocation에 대해 자세히 알아보기

질문:

2020년 1월 22일

댓글:

2020년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by