# 6.12.36: PDuration formula appears incorrect

XMLWordPrintable

#### Details

• Type: Bug
• Status: Applied
• Priority: Major
• Resolution: Fixed
• Affects Version/s: ODF 1.2 CD 05
• Fix Version/s:
• Component/s:
• Labels:
None

#### Description

I believe that the denominator in the Pduration formula should be log(1+rate), not log(rate)

Actual:
PDURATION=(log⁡(desiredValue)-log⁡(currentValue))/log⁡(rate)

Expected:
PDURATION=(log⁡(desiredValue)-log⁡(currentValue))/log⁡(1+rate)

From wolfram the formula for interest calculations is
FV = PV(1 + r/f)^(nf)
where
FV = future value
PV = present value
r = interest rate
f = compounding frequency
n = number of periods

Given that pduration makes no mention of any compounding frequency it should be assumed to be 1. so the formula becomes
FV = PV(1 + r)^n

In the case of PDURATION we want to solve for n given FV, PV, and r

FV / PV = (1 + r)^n
n = log_(1+r)(FV/PV) where log_(1+r) is log base 1+ r
through change of base formula
n = log_(1+r)(FV/PV) = log(FV/PV) / log(1+r) = (log(FV) - log(PV))/log(1+r) where the base of log is irrelevant so long as it is consistent.

Below is a less rigorous justification for the (1+r) in the original equation:
The (1+r) is originally present in the compound interest formula as r is simply the rate of interest, not the growth factor. An investment that grows as 6% would have r = 0.06. Over 1 term r*PV evaluates to only the growth of the investment. We must add to the growth the value of the original investment. so FV = PV + r*PV = PV*(1+r). Hence the original growth factor in the formula must be (1+r) and the derivation from that to the PDURATION formula has already been shown.

#### People

• Assignee:
Robert Weir (Inactive)
Reporter:
Eric Patterson
• Watchers:
0 Start watching this issue

#### Dates

• Created:
Updated:
Resolved: