The savings Library¶
Overview¶
The savings library is for modeling savings products, such as universal life, unit-linked, variable life and annuities. These saving products have investment features. Most part of premiums paid by the policyholder of such products is kept as the account value of the policy.
The models in this library include the account value logic,
and differ from the basiclife
models in the following points.
In the
basiclife
models, premiums are calculated so that the present value of premiums cover the present value of claims. In thesavings
models, premiums are given as input, whether they are a single premium or recurring premiums.In the
savings
models, most part of the premium received from a policyholder is transferred to the account value. When the policy holder exits, whether by death, lapse or maturity, the account value of the policyholder is used to fund the claim paid to the policyholder.During each time step, the account value increases by the amount transferred from premiums, positive investment returns or interest credited, and decrease by the transferred amounts of claims, negative investment returns, and deducted fees. The beginning balance of the account value plus the changes in account value should reconcile to the ending balance of the account value.
The death benefit amount is by default set equal to the premium amount, or the accumulated premium amount for recurring premium types of products. This spec should be customized by the user. When the account value increases above the premium amount, the account value is paid as the death benefit. By default, cost of insurance charges are deducted from the account value.
The net cashflows of the saving models can be presented in two ways, gross of the account value and net of the account value. The gross presentation shows investment return on account value and change in account value, in addition to premiums, claims, expenses. The net presentation better depict the sources of profit and looses, and can be expressed as the sum of mortality margin adn expense margin.
The library currently includes 2 models.
CashValue_SE
and CashValue_ME
produce the exact same results but in different ways.
The CashValue_SE
model defines and executes formulas for each model point separately,
while the CashValue_ME
model executes each formula at each time step
for all model points at once. They produce the same results for the same model point.
CashValue_SE
is straight forward, and its formulas are easier to understand,
but it runs slower. It’s suitable for validation purposes.
CashValue_ME
runs fast, but its formulas are expressed as vector operations
and can be more complex in some places.
CashValue_SE
and CashValue_ME
project the cashflows of in-force policies at time 0 as well as
new business policies at 0 or any future time.
CashValue_ME
is to CashValue_SE
as BasicTerm_M
is BasicTerm_S
.
Formulas in CashValue_ME
apply to all the model point
at a time while CashValue_SE
carries out
projection for each model point separately.
How to Use the Library¶
As explained in the Copying a Library section, Create you own copy of the savings library. For example, to copy as a folder named savings under the path C:\path\to\your\, type below in an IPython console:
>>> import lifelib
>>> lifelib.create("savings", r"C:\path\to\your\savings")
Examples¶
Library Contents¶
File or Folder |
Description |
---|---|
CashValue_SE |
The |
CashValue_ME |
The |
cash_value_sample.xlsx |
An Excel file that reproduces the results of a selected model point. The file also shows the derivation of the sample mortality rates. |
CashValue_ME_EX1 |
The example model for savings_example1.ipynb |
CashValue_ME_EX2 |
The example model for savings_example2.ipynb |
savings_example1.ipynb |
Jupyter notebook 1. Simple Stochastic Example |
savings_example2.ipynb |
Jupyter notebook 2. Extended Stochastic Example |
savings_example3.ipynb |
Jupyter notebook 3. Memory-Optimized Mutiprocess Example |
generate_100K_model_points.ipynb |
Jupyter notebook used for generating the large model point data for 3. Memory-Optimized Mutiprocess Example. |
plot_ex1_av_paths.py |
Python script for Account value paths |
plot_ex1_rand.py |
Python script for Account value distribution |
plot_ex1_option_value.py |
Python script for Monte Carlo vs Black-Scholes-Merton |
plot_ex2_comp_option_values.py |
Python script for Black-Scholes-Merton on dividend paying stock |
plot_ex2_lapse_decrement.py |
Python script for Dynamic policy decrement |
plot_ex2_av_to_pols.py |
Python script for Account value to number of policies |