.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated_examples\savings\plot_ex2_lapse_decrement.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_examples_savings_plot_ex2_lapse_decrement.py: Dynamic policy decrement =================================== As explained in :doc:`/libraries/savings/savings_example2`, most variable annuity models include dynamic lapse assumptions. A dynamic lapse assumption is used to reflect such policy holder's behaviour that they are more likely to terminate their policies when their account values are larger in comparison to the guaranteed amounts of their policies than they are when the account values are smaller than the guaranteed amounts. The graph shows deterministic lapse rates and policy decrement based on the lapse rates. The lates and derement do not vary by scenarios. .. GENERATED FROM PYTHON SOURCE LINES 15-31 .. code-block:: default import numpy as np import pandas as pd import modelx as mx import matplotlib.pyplot as plt model = mx.read_model('CashValue_ME_EX2') proj = model.Projection pd.Series(proj[4].lapse_rate(t).loc[1][1] for t in range(120)).plot.line( legend=False, grid=True, title='Lapse rate by duration') plt.subplots() pd.Series(proj[4].pols_if_at(t, 'BEF_DECR').loc[1][1] for t in range(120)).plot.line( legend=False, grid=True, title='Number of policies') .. rst-class:: sphx-glr-horizontal * .. image-sg:: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_001.png :alt: Lapse rate by duration :srcset: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_001.png :class: sphx-glr-multi-img * .. image-sg:: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_002.png :alt: Number of policies :srcset: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_002.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 32-36 The graph below shows lapse rates and policy decrement for the first 100 scenarios, when a dynamic lapse is factored into the assumption. The lapse rates vary by in-the-moneyness of the account value and the number of remaining policies also vary by scenarios. .. GENERATED FROM PYTHON SOURCE LINES 36-45 .. code-block:: default df = pd.DataFrame({t: proj[5].lapse_rate(t).loc[1][:100] for t in range(120)}) df.transpose().plot.line(legend=False, grid=True, title='Lapse rate by duration') df = pd.DataFrame({t: proj[5].pols_if_at(t, 'BEF_DECR').loc[1][:100] for t in range(120)}) df.transpose().plot.line(legend=False, grid=True, title='Number of policies') model.close() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_003.png :alt: Lapse rate by duration :srcset: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_003.png :class: sphx-glr-multi-img * .. image-sg:: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_004.png :alt: Number of policies :srcset: /generated_examples/savings/images/sphx_glr_plot_ex2_lapse_decrement_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 46-49 .. seealso:: * :doc:`/libraries/savings/savings_example2` notebook in the :mod:`~savings` library .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.248 seconds) .. _sphx_glr_download_generated_examples_savings_plot_ex2_lapse_decrement.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_ex2_lapse_decrement.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ex2_lapse_decrement.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_