 Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Cash Flow Analysis : Finance/NetPresentValue

Finance

 NetPresentValue
 return the net present value of future cash flows

 Calling Sequence NetPresentValue(instrument) NetPresentValue(cashflows, discountrate, opts)

Parameters

 instrument - cash flow swap or an interest rate swap; financial instrument cashflows - data structure created using the SimpleCashFlow constructor or a list of such data structures; cash flows discountrate - non-negative constant or a yield term structure; discount rate opts - equations of the form option = value where option is one of referencedate or daycounter; specify options for the NetPresentValue command

Options

 • daycounter =  a string containing a date specification in a format recognized by ParseDate or a Date data structure -- This option specifies a day counter or day counting convention.
 • referencedate =  a string containing a date specification in a format recognized by ParseDate or a Date data structure -- This option specifies the reference date, that is, the date when the discount factor is 1. By default this is set to the global evaluation date.

Description

 • The NetPresentValue(instrument) calling sequence returns the net present value of the given instrument. The parameter instrument in this case can be either a cash flow swap or an interest rate swap. For bonds the net present value is the same as the dirty price (see DirtyPrice).
 • The NetPresentValue(cashflows, discountrate, opts) calling sequence returns the net present value for the future cash flows discounted with respect to the given discount rate.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

First set the global evaluation date.

 > $\mathrm{SetEvaluationDate}\left("January 01, 2005"\right):$
 > $\mathrm{EvaluationDate}\left(\right)$
 ${"January 1, 2005"}$ (1)

Calculate the net present value of 100 dollars to be paid on January 2, 2007.

 > $\mathrm{paymentdate}≔"Jan-02-2007"$
 ${\mathrm{paymentdate}}{≔}{"Jan-02-2007"}$ (2)
 > $\mathrm{cashflow1}≔\mathrm{SimpleCashFlow}\left(100,\mathrm{paymentdate}\right)$
 ${\mathrm{cashflow1}}{≔}{\mathrm{100. on January 2, 2007}}$ (3)
 > $\mathrm{NetPresentValue}\left(\mathrm{cashflow1},0.03\right)$
 ${94.16871315}$ (4)
 > $100\mathrm{DiscountFactor}\left(0.03,\mathrm{paymentdate}\right)$
 ${94.16871315}$ (5)
 > $\mathrm{NetPresentValue}\left(\mathrm{cashflow1},0.03,\mathrm{referencedate}="Jan-01-2004"\right)$
 ${91.38560707}$ (6)
 > $100\mathrm{DiscountFactor}\left(0.03,\mathrm{paymentdate},\mathrm{referencedate}="Jan-01-2004"\right)$
 ${91.38560707}$ (7)

Here is another example.

 > $\mathrm{nominalamt}≔100$
 ${\mathrm{nominalamt}}{≔}{100}$ (8)
 > $\mathrm{rate}≔0.05$
 ${\mathrm{rate}}{≔}{0.05}$ (9)
 > $\mathrm{paymentdate}≔"Jan-01-2015"$
 ${\mathrm{paymentdate}}{≔}{"Jan-01-2015"}$ (10)
 > $\mathrm{startdate}≔"Jan-01-2006"$
 ${\mathrm{startdate}}{≔}{"Jan-01-2006"}$ (11)
 > $\mathrm{enddate}≔"Jan-01-2010"$
 ${\mathrm{enddate}}{≔}{"Jan-01-2010"}$ (12)
 > $\mathrm{coupon}≔\mathrm{FixedRateCoupon}\left(\mathrm{nominalamt},\mathrm{rate},\mathrm{startdate},\mathrm{enddate},\mathrm{paymentdate}\right)$
 ${\mathrm{coupon}}{≔}{\mathrm{20. on January 1, 2015}}$ (13)

Compute the value of this cash flow on January 1, 2005.

 > $\mathrm{NetPresentValue}\left(\mathrm{coupon},0.03\right)$
 ${14.81636441}$ (14)

Here is another way to compute this. First, compute the accrued interest.

 > $\mathrm{accrued}≔\mathrm{nominalamt}\mathrm{CompoundFactor}\left(\mathrm{rate},\mathrm{enddate},\mathrm{referencedate}=\mathrm{startdate},\mathrm{compounding}='\mathrm{Simple}'\right)-\mathrm{nominalamt}$
 ${\mathrm{accrued}}{≔}{20.0000000}$ (15)

This is the value to be received on January 1, 2010. Discount this value using the discount rate.

 > $\mathrm{accrued}\mathrm{DiscountFactor}\left(0.03,\mathrm{paymentdate}\right)$
 ${14.81636441}$ (16)

Compute with a difference day counter.

 > $\mathrm{NetPresentValue}\left(\mathrm{coupon},0.03,\mathrm{daycounter}=\mathrm{DayCounter}\left(\mathrm{Actual360}\right)\right)$
 ${14.75229908}$ (17)

Compatibility

 • The Finance[NetPresentValue] command was introduced in Maple 15.