# Modified Dietz method

(Redirected from Modified Dietz Method)

The modified Dietz method[1] [1] is a measure of the historical performance of an investment portfolio in the presence of external flows. (External flows are movements of value such as transfers of cash, securities or other instruments in or out of the portfolio, with no equal simultaneous movement of value in the opposite direction, and which are not income from the investments in the portfolio, such as interest, coupons or dividends.) To calculate the modified Dietz return, divide the gain or loss in value, net of external flows, by the average capital over the period of measurement. The result of the calculation is expressed as a percentage rate of return for the time period. The average capital weights individual cash flows by the amount of time from when those cash flows occur until the end of the period.

The method is named after Peter O. Dietz.

## Formula

The formula for the modified Dietz method is as follows:

$R_{MDietz}= \cfrac{Gain}{Average Capital}= \cfrac{ EMV - BMV - F}{ BMV+ \sum_{i=1}^n W_i \times F_i}$

where

$EMV$ is the ending market value
$BMV$ is the beginning market value
$F$ is the net external inflow for the period (contributions to a portfolio are entered as positive flows while withdrawals are entered as negative flows)

and

$\sum_{i=1}^n W_i \times {F_i} =$ the sum of each flow $F_i$ multiplied by its weight $W_i$

The weight $W_i$ is the proportion of the time period between the point in time when the flow $F_i$ occurs and the end of the period. $W_i$ can be calculated as

$W_i = \frac{CD-D_i}{CD}$

where

$CD$ is the number of calendar days during the return period being calculated, which equals end date minus start date plus 1
$D_i$ is the number of days from the start of the return period until the day on which the flow $F_i$ occurred. This assumes that the flow happens at the end of the day. If the flow happens at the beginning of the day, use the following formula for calculating weight: $W_i = \frac{CD -D_i + 1}{CD}$

## Fees

To measure returns net of fees, allow the value of the portfolio to be reduced by the amount of the fees. To calculate returns gross of fees, compensate for them by treating them as an external flow, and exclude accrued fees from valuations.

## Comparison with Time-Weighted Return and Internal Rate of Return

The Modified Dietz method has the practical advantage over the true time-weighted rate of return method, in that the calculation of a Modified Dietz return does not require portfolio valuations at each point in time whenever an external flow occurs. The internal rate of return method shares this practical advantage with the Modified Dietz method.

The Modified Dietz method has the practical advantage over the internal rate of return method, in that there is a formula for the Modified Dietz return, whereas iterative numerical methods are usually required to estimate the internal rate of return.

The Modified Dietz method is based upon a simple rate of interest principle. It approximates the internal rate of return method, which applies a compounding principle, but if the flows and rates of return are large enough, the results of the Modified Dietz method will significantly diverge from the internal rate of return.

The Modified Dietz return is the solution $R$ to the equation:

$EMV = BMV \times (1+R)+ \sum_{i=1}^n F_i \times (1+R \times \frac{T - t_i}{T})$

where

$EMV$ is the ending market value
$BMV$ is the beginning market value
$T$ is the total length of time period

and

$t_i$ is the time between the start of the period and flow $i$

Compare this with the internal rate of return, which is the solution $R$ to the equation:

$EMV = BMV \times (1+R)+ \sum_{i=1}^n F_i \times (1+R)^ \frac{T - t_i}{T}$

For example, suppose the value of a portfolio is 100 USD at the beginning of the first year, and 300 USD at the end of the second year, and there is an inflow of 50 USD at the end of the first year/beginning of the second year. (Suppose further that neither year is a leap year, so the two years are of equal length.)

To calculate the gain or loss over the two-year period,

$Gain Or Loss = EMV - BMV - F = 300 - 100 - 50 = 150 USD$

To calculate the average capital over the two-year period,

$Average Capital = BMV + \sum Weight \times Flow = 100 + 0.5 \times 50 = 125 USD$

so the Modified Dietz return is:

$Gain Or Loss/Average Capital = 150/125 = 120%$

The internal rate of return in this example is 125%:

$300 = 100 \times (1 + 125%)+ 50 \times (1+125%)^ \frac{2 - 1}{2} = 225 + 50 \times 150% = 225 + 75$

so in this case, the Modified Dietz return is noticeably less than the IRR. This divergence between the Modified Dietz return and the internal rate of return is due to a significant flow within the period, and the fact that the returns are large.

## Annual Rate of Return

Note that the Modified Dietz return is not an annual rate of return, unless the period happens to be one year. Annualisation, which is conversion of the return to an annual rate of return, is a separate process.

## The Simple Dietz Method

Note also that the simple Dietz method is a special case of the Modified Dietz method, in which external flows are assumed to occur at the midpoint of the period, or equivalently, spread evenly throughout the period, whereas no such assumption is made when using the Modified Dietz method, and the timing of any external flows is taken into account.

## Money-Weighted Return

The Modified Dietz method is an example of a money (or dollar) weighted methodology. In particular, if the Modified Dietz return on two portfolios are $R_1$ and $R_2$, measured over a common matching time interval, then the Modified Dietz return on the two portfolios put together over the same time interval is the weighted average of the two returns:

$W_1 \times R_1+W_2 \times R_2$

where the weights of the portfolios depend on the Average Capital over the time interval:

$W_i = \frac{Average Capital_i}{Average Capital_1+Average Capital_2}$

## Linked Return versus True Time-Weighted Return

An alternative to the Modified Dietz method is to link geometrically the Modified Dietz returns for shorter periods. This method is classed as a time-weighted method, but does not produce the same results as the true time weighted method, which requires valuations at the time of each cash flow.

## Issues

There are sometimes difficulties when calculating or decomposing portfolio returns, if all transactions are treated as occurring at a single point during the day. Whatever method is applied to calculate returns, an assumption that all transactions take place simultaneously at a single point in time each day can lead to errors.

For example, consider a scenario where a portfolio is empty at the start of a day, so that BMV = 0. There is then an external inflow during a day of F = $100. By the close of the day, market prices have moved, and EMV =$99.

If all transactions are treated as occurring at the end of the day, then there is zero start value BMV, and zero value for Average Capital, so no Modified Dietz return can be calculated.

Some such problems are resolved if the Modified Dietz method is further adjusted so as to put purchases at the open and sales at the close, but more sophisticated exception-handling produces better results.

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 wi (as opposed to the time weights Wi) 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.

## Excel VBA function for modified Dietz return

Public Function MDIETZ(dStartValue As Double, dEndValue As Double, iPeriod As Integer, rCash As Range, rDays As Range) As Double

'Jelle-Jeroen Lamkamp 10 Jan 2008
Dim i As Integer: Dim Cash() As Double: Dim Days() As Integer
Dim Cell As Range: Dim SumCash As Double: Dim TempSum As Double

'Some error trapping
If rCash.Cells.Count <> rDays.Cells.Count Then MDIETZ = CVErr(xlErrValue): Exit Function
If Application.WorksheetFunction.Max(rDays) > iPeriod Then MDIETZ = CVErr(xlErrValue): Exit Function

ReDim Cash(rCash.Cells.Count - 1)
ReDim Days(rDays.Cells.Count - 1)

i = 0
For Each Cell In rCash
Cash(i) = Cell.Value: i = i + 1
Next Cell

i = 0
For Each Cell In rDays
Days(i) = Cell.Value: i = i + 1
Next Cell

SumCash = Application.WorksheetFunction.Sum(rCash)

TempSum = 0
For i = 0 To (rCash.Cells.Count - 1)
TempSum = TempSum + (((iPeriod - Days(i)) / iPeriod) * Cash(i))
Next i

MDIETZ = (dEndValue - dStartValue - SumCash) / (dStartValue + TempSum)

End Function


The above VBA program is designed to use with Excel. Here is a Java program written for general purposes.

## Java Method for Modified Dietz Return

private static double modifiedDietz (double emv, double bmv, double cashFlow[], int numCD, int numD[]) {

/* emv:        Ending Market Value
* bmv:        Beginning Market Value
* cashFlow[]: Cash Flow
* numCD:      actual number of days in the period
* numD[]:     number of days between beginning of the period and date of cashFlow[]
*/

double md = -99999; // initialize modified dietz with a debugging number

try {

double[] weight = new double[cashFlow.length];

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;
}

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];
}

md = (emv - bmv - tncf) / (bmv + ttwcf);
}
catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
}
catch (ArithmeticException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}

return md;
}