-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpresent_value.py
More file actions
117 lines (89 loc) · 2.79 KB
/
present_value.py
File metadata and controls
117 lines (89 loc) · 2.79 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# -*- coding: utf-8 -*-
"""Present Value mix-in modules
This module defines cells that take present values of projected items
in :mod:`projection <simplelife.projection>` module.
"""
def PV_SumInsurIF(t):
"""Present value of insurance in-force"""
if t > last_t:
return 0
else:
return InsurIF_Beg1(t) + PV_SumInsurIF(t+1) / (1 + DiscRate(t))
def PV_PremIncome(t):
"""Present value of premium income"""
if t > last_t:
return 0
else:
return PremIncome(t) + PV_PremIncome(t+1) / (1 + DiscRate(t))
def PV_BenefitSurr(t):
"""Present value of surrender benefits"""
if t > last_t:
return 0
else:
return (-BenefitSurr(t) + PV_BenefitSurr(t+1)) / (1 + DiscRate(t))
def PV_BenefitDeath(t):
"""Present value of death benefits"""
if t > last_t:
return 0
else:
return (-BenefitDeath(t) + PV_BenefitDeath(t+1)) / (1 + DiscRate(t))
def PV_BenefitMat(t):
"""Present value of matuirty benefits"""
if t > last_t:
return 0
else:
return (-BenefitMat(t) + PV_BenefitMat(t+1)) / (1 + DiscRate(t))
def PV_BenefitTotal(t):
"""Present value of total benefits"""
if t > last_t:
return 0
else:
return (-BenefitTotal(t) + PV_BenefitTotal(t+1)) / (1 + DiscRate(t))
def PV_ExpsCommTotal(t):
"""Present value of commission expenses"""
if t > last_t:
return 0
else:
return - ExpsCommTotal(t) + PV_ExpsCommTotal(t+1) / (1 + DiscRate(t))
def PV_ExpsAcq(t):
"""Present value of acquisition expenses"""
if t > last_t:
return 0
else:
return - ExpsAcq(t) + PV_ExpsAcq(t+1) / (1 + DiscRate(t))
def PV_ExpsMaint(t):
"""Present value of maintenance expenses"""
if t > last_t:
return 0
else:
return - ExpsMaint(t) + PV_ExpsMaint(t+1) / (1 + DiscRate(t))
def PV_ExpsTotal(t):
"""Present value of total expenses"""
if t > last_t:
return 0
else:
return - ExpsTotal(t) + PV_ExpsTotal(t+1) / (1 + DiscRate(t))
def PV_NetCashflow(t):
"""Present value of net cashflow"""
return (PV_PremIncome(t)
+ PV_ExpsTotal(t)
+ PV_BenefitTotal(t))
def PV_NetCashflowForCheck(t):
"""Present value of net cashflow"""
if t > last_t:
return 0
else:
return (PremIncome(t)
- ExpsTotal(t)
- BenefitTotal(t) / (1 + DiscRate(t))
+ PV_NetCashflow(t+1) / (1 + DiscRate(t)))
def PV_Check(t):
return PV_NetCashflow(t) - PV_NetCashflowForCheck(t)
def InterestNetCF(t):
"""Interest accreted on pv of net cashflows"""
if t > last_t:
return 0
else:
return (PV_NetCashflow(t)
- PremIncome(t)
+ ExpsTotal(t)) * DiscRate(t)