simplelife present values of cashflows

Present values of liability cashflows of a simple whole life policy.

../../_images/sphx_glr_plot_pvcashflows_001.png

Out:

Started loading data from 'input.xlsx'.
Loading PolicyData...C:\Users\fumito\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
Done. (1.43secs)
Loading MortalityTables...Done. (0.27secs)
Loading ProductSpec...Done. (0.27secs)
Loading OtherParam1...Done. (0.29secs)
Loading OtherParams2...Done. (0.23secs)
Loading Assumption...Done. (0.32secs)
Loading AssumptionTables...Done. (0.24secs)
Loading Scenarios...Done. (0.33secs)
Input space and its sub spaces are saved in '[project name].mx'.
You can load input data from the saved file instead of 'input.xlsx'
by passing 'load_saved=True' to simplelife.build function.
C:\Users\fumito\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)
C:\Users\fumito\Anaconda3\lib\importlib\_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
  return f(*args, **kwds)

try:
    import simplelife.simplelife as simplelife
except ImportError:
    import simplelife

proj = simplelife.build().Projection

vars = ['PV_PremIncome',
        'PV_BenefitSurr',
        'PV_BenefitDeath',
        'PV_ExpsMaint',
        'PV_ExpsCommTotal',
        'PV_ExpsAcq']

polid = 171

for cells in vars:
    list(proj[polid].cells[cells](t) for t in range(50))

cfs = proj[polid].frame[vars].sort_index().dropna()

[proj[polid].PV_NetCashflow[t] for t in range(50)]

ncf = proj[polid].PV_NetCashflow.frame.sort_index()

import seaborn as sns
sns.set()

axes = ncf.plot.line(marker='o', color='r')
cfs.plot(kind='bar', stacked=True, ax=axes)

Total running time of the script: ( 0 minutes 6.832 seconds)

Gallery generated by Sphinx-Gallery