simplelife cashflowΒΆ

Draw a graph of liability cashflows of a simple whole life policy



Started loading data from 'input.xlsm'.
...Loaded PolicyData (5.48secs)
...Loaded MortalityTables (2.41secs)
...Loaded ProductSpec (1.99secs)
...Loaded OtherParam1 (1.92secs)
...Loaded OtherParams2 (1.99secs)
...Loaded Assumptions (1.97secs)
...Loaded AssumptionTables (1.95secs)
...Loaded Scenarios (2.22secs)
Input space and its sub spaces are saved in ''.
You can load input data from the saved file instead of 'input.xlsx'
by passing 'load_saved=True' to function.

    import simplelife.simplelife as simplelife
except ImportError:
    import simplelife

proj =

vars = ['prj_incm_Premium',

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()
cfs[vars[1:]] = cfs[vars[1:]].mul(-1)

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

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

import seaborn as sns

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

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

Gallery generated by Sphinx-Gallery