summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_financial.py
blob: c3153ffb975c5efe790618bbe6b8ad232c21a007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
from numpy import *

>>> rate(10,0,-3500,10000)
0.11069085371426901

>>> irr([-150000, 15000, 25000, 35000, 45000, 60000])
0.052432888859414106

>>> pv(0.07,20,12000,0)
-127128.17094619398

>>> fv(0.075, 20, -2000,0,0)
86609.362673042924

>>> pmt(0.08/12,5*12,15000)
-304.14591432620773

>>> nper(0.075,-2000,0,100000.)
21.544944197323336

>>> npv(0.05,[-15000,1500,2500,3500,4500,6000])
117.04271900089589

>>> mirr([-4500,-800,800,800,600,600,800,800,700,3000],0.08,0.055)
0.066471183500200537

>>> mirr([-120000,39000,30000,21000,37000,46000],0.10,0.12)
0.13439316981387006
"""

from numpy.testing import *
import numpy as np

class TestDocs(NumpyTestCase):
    def check_doctests(self): return self.rundocs()

if __name__ == "__main__":
    NumpyTest().run()