計算

我可以計算持有不同時間長度的投資的平均年化回報嗎?

  • August 1, 2018

**我的問題是:**給定一些不同數量的投資,持有不同的時間長度,我將如何計算整個投資組合在其生命週期內的近似平均年化增長率?(我假設從這些數據中不可能得到準確的答案。)

在我的投資組合中,我跟踪了以下數據:

  • 購買日期
  • 採購成本
  • 收到的股息
  • 出售日期
  • 售價

由此我可以計算:

  • 利潤/虧損(售價 + 股息 - 購買成本)
  • 實際增長(利潤/虧損 ÷ 採購成本)
  • 持有年數(出售日期 - 購買日期)÷ 365
  • 年化增長((銷售價值 + 股息)/PurchaseCost ^(1/持有年數)) - 1

以下是一些現實世界的價值觀,如果有幫助的話:

範例數據

在下面的方法中,計算每個時間間隔的所有投資組合值。然後將它們在每個時間段內匯總併計算期間回報。最後,期間回報是複合和年化的。

例如,投資組合在周期之間的x5回報x6

(a11 + a23 + a34)/(a1 + a22 + a33) - 1 = 0.903 %

其中a1是資產 1 的起始價值,a11是資產 1 在一段時間後的價值。如果知道實際值,這將給出更好的結果,但考慮到它們的計算資訊有限。

複合期間回報與採用時間加權回報相同。

在此處輸入圖像描述

s1 = {2017, 6, 7};
e1 = {2017, 12, 4};
s2 = {2015, 9, 2};
e2 = {2017, 11, 1};
s3 = {2015, 2, 25};
e3 = {2017, 7, 3};
s4 = {2015, 2, 20};
e4 = {2017, 6, 2};

d1 = QuantityMagnitude@DateDifference[s1, e1, "Day"];
d2 = QuantityMagnitude@DateDifference[s2, e2, "Day"];
d3 = QuantityMagnitude@DateDifference[s3, e3, "Day"];
d4 = QuantityMagnitude@DateDifference[s4, e4, "Day"];

a1 = 4606.75;
v1 = 4529 + 27.48;
a2 = 3500;
v2 = 5827 + 56;
a3 = 2900;
v3 = 3998 + 72;
a4 = 2900;
v4 = 3566;

r1 = (v1/a1)^(1/d1) - 1.0
r2 = (v2/a2)^(1/d2) - 1.0
r3 = (v3/a3)^(1/d3) - 1.0
r4 = (v4/a4)^(1/d4) - 1.0
-0.0000609549
0.000656731
0.000394644
0.000248211

以上是四種資產的每日收益率。

x1 = {2015, 2, 20};
x2 = {2015, 2, 25};
x3 = {2015, 9, 2};
x4 = {2017, 6, 2};
x5 = {2017, 6, 7};
x6 = {2017, 7, 3};
x7 = {2017, 11, 1};
x8 = {2017, 12, 4};

k1 = QuantityMagnitude@DateDifference[x1, x2, "Day"];
k2 = QuantityMagnitude@DateDifference[x2, x3, "Day"];
k3 = QuantityMagnitude@DateDifference[x3, x4, "Day"];
k4 = QuantityMagnitude@DateDifference[x4, x5, "Day"];
k5 = QuantityMagnitude@DateDifference[x5, x6, "Day"];
k6 = QuantityMagnitude@DateDifference[x6, x7, "Day"];
k7 = QuantityMagnitude@DateDifference[x7, x8, "Day"];

a41 = a4 (1 + r4)^k1;
a42 = a41 (1 + r4)^k2;
a43 = a42 (1 + r4)^k3
3566.

資產 4 在三個週期後的計算值與上述最終值相同v4

a31 = a3 (1 + r3)^k2;
a32 = a31 (1 + r3)^k3;
a33 = a32 (1 + r3)^k4;
a34 = a33 (1 + r3)^k5
4070.
a21 = a2 (1 + r2)^k3;
a22 = a21 (1 + r2)^k4;
a23 = a22 (1 + r2)^k5;
a24 = a23 (1 + r2)^k6
5883.
a11 = a1 (1 + r1)^k5;
a12 = a11 (1 + r1)^k6;
a13 = a12 (1 + r1)^k7
4556.48
z1 = a41/a4;
z2 = (a31 + a42)/(a3 + a41);
z3 = (a21 + a32 + a43)/(a2 + a31 + a42);
z4 = (a22 + a33)/(a21 + a32);
z5 = (a11 + a23 + a34)/(a1 + a22 + a33);
z6 = (a12 + a24)/(a11 + a23);
z7 = a13/a12;

k = QuantityMagnitude@DateDifference[x1, x8, "Day"];

(z1*z2*z3*z4*z5*z6*z7)^(365/k) - 1
0.154885

因此投資組合的年回報率為 15.49%。

引用自:https://money.stackexchange.com/questions/98130