Modified Dietz method: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{Short description|Historical performance of an investment portfolio}}
The '''modified Dietz method'''<ref name="Dietz1966">{{cite book
|author=Peter O. Dietz
Line 300 ⟶ 301:
There are sometimes other difficulties when decomposing portfolio returns, if all transactions are treated as occurring at a single point during the day.
 
For example, consider a fund opening with just $100 of a single stock that is sold for $110 during the day. During the same day, another stock is purchased for $110, closing with a value of $120. The returns on each stock are 10% and 120/110 - 1 = 9.0909% (4 d.p.) and the portfolio return is 20%. The asset weights ''w<sub>i</sub>'' (as opposed to the time weights ''W<sub>i</sub>'') required to get the returns for these two assets to roll up to the portfolio return are 1200% for the first stock and a negative 1100% for the second:
 
:w*10/100 + (1-w)*10/110 = 20/100 → w = 12.
 
Such weights are absurd, because the second stock is not held short.
Line 322 ⟶ 323:
:At the end of Day 40, the remaining 20 shares are worth 12.50 dollars per share
 
The gain or loss is end value - start value + outflow:
 
:<math>20 \times 12.50 - 100 \times 10 + 80 \times 15</math>
Line 452 ⟶ 453:
==Java method for modified Dietz return==
<syntaxhighlight lang="java">
private static double modifiedDietz (double emv, double bmv, double cashFlow[], int numCD, int numD[]) {
 
/* emv: Ending Market Value
Line 467 ⟶ 468:
 
if (numCD <= 0) {
throw new ArithmeticException ("numCD <= 0");
}
 
for (int i = 0; i < cashFlow.length; i++) {
if (numD[i] < 0) {
throw new ArithmeticException ("numD[i]<0 , " + "i=" + i);
}
weight[i] = (double) (numCD - numD[i]) / numCD;
Line 478 ⟶ 479:
 
double ttwcf = 0; // total time weighted cash flows
for (int i = 0; i < cashFlow.length; i++) {
ttwcf += weight[i] * cashFlow[i];
}
 
double tncf = 0; // total net cash flows
for (int i = 0; i < cashFlow.length; i++) {
tncf += cashFlow[i];
}