Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.pv

numpy.pv(rate,nper,pmt,fv=0,when='end')[source]

Compute the present value.

Given:
  • a future value,fv
  • an interestrate compounded once per period, of whichthere are
  • nper total
  • a (fixed) payment,pmt, paid either
  • at the beginning (when = {‘begin’, 1}) or the end(when = {‘end’, 0}) of each period
Return:
the value now
Parameters:
rate:array_like

Rate of interest (per period)

nper:array_like

Number of compounding periods

pmt:array_like

Payment

fv:array_like, optional

Future value

when:{{‘begin’, 1}, {‘end’, 0}}, {string, int}, optional

When payments are due (‘begin’ (1) or ‘end’ (0))

Returns:
out:ndarray, float

Present value of a series of payments or investments.

Notes

The present value is computed by solving the equation:

fv+pv*(1+rate)**nper+pmt*(1+rate*when)/rate*((1+rate)**nper-1)=0

or, whenrate=0:

fv+pv+pmt*nper=0

forpv, which is then returned.

References

[WRW]Wheeler, D. A., E. Rathke, and R. Weir (Eds.) (2009, May).Open Document Format for Office Applications (OpenDocument)v1.2,Part 2: Recalculated Formula (OpenFormula) Format - Annotated Version,Pre-Draft 12. Organization for the Advancement of Structured InformationStandards (OASIS). Billerica, MA, USA. [ODT Document].Available:http://www.oasis-open.org/committees/documents.php?wg_abbrev=office-formulaOpenDocument-formula-20090508.odt

Examples

What is the present value (e.g., the initial investment)of an investment that needs to total $15692.93after 10 years of saving $100 every month? Assume theinterest rate is 5% (annually) compounded monthly.

>>>np.pv(0.05/12,10*12,-100,15692.93)-100.00067131625819

By convention, the negative sign represents cash flow out(i.e., money not available today). Thus, to end up with$15,692.93 in 10 years saving $100 a month at 5% annualinterest, one’s initial deposit should also be $100.

If any input is array_like,pv returns an array of equal shape.Let’s compare different interest rates in the example above:

>>>a=np.array((0.05,0.04,0.03))/12>>>np.pv(a,10*12,-100,15692.93)array([ -100.00067132,  -649.26771385, -1273.78633713])

So, to end up with the same $15692.93 under the same $100 per month“savings plan,” for annual interest rates of 4% and 3%, one wouldneed initial investments of $649.27 and $1273.79, respectively.

Previous topic

numpy.fv

Next topic

numpy.npv

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp