Using the life tables of the Dominican Republic for the year 2000, and through financial and Actuarial stochastic models, develop a series of functions in Python for the valuation of simple life insurance based on the calculation of the expected present value, as you will see in detail below.
through the function: life_annuity_due(age,interesRate, sex) for example a Male ,20 year and interest rate = 3%
life_annuity_due(20,0.03,"M")
[26.99898183]
life immediaty annuity
through the function: life_immediaty_annuity(age,interesRate, sex) for example a Male ,20 year and interest rate = 3%
life_immediaty_annuity(20,0.03,"M")
[28.10594413]
temporary life annuity due
through the function: temporary_life_annuity_due(age,interesRate,n, sex) for example a Male ,20 year ,period of 10 years and interest rate = 3%
temporary_life_annuity_due(20,0.03,10,"M")
[27.10594413]
whole life insurance
through the function: whole_life_insurance(age,interesRate,sex)
for example a Male ,20 year and interest rate = 3%
whole_life_insurance(20,0.03,"M")
[9.48982548]
doing some plots includes in the functions
plot_by_age(whole_life_insurance,0.03,"M")

plot_by_rate(whole_life_insurance,"M",20)
temporary life insurance
through the function: temporary_life_insurance(age,interesRate,n,"M")
for example a male,20 year, interest rate= 3% a duration of 45 year
temporary_life_insurance(20,0.03,45,"M")
[0.07455318]
trough the function: deferred_whole_life_insurance(age,deferred,interestRate,sex)
for example a male, 20 year, interest rate=3% and deferred 10 periods deferred_whole_life_insurance(20,10,0.03,"M")
0.2050367514161077





