Geomean on returns with negative values?

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 件のコメント

riccardo manfredi
riccardo manfredi 2020 年 1 月 23 日
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" :)
riccardo manfredi
riccardo manfredi 2020 年 1 月 23 日
perfect, thanks again

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePortfolio Optimization and Asset Allocation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by