# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Convert vector descriptions of mortality into another representation

Contributed by:
Seth J. Chandler

ResourceFunction["MortalityConvert"][ takes a |

The numeric values of a survival representation of mortality should be monotonically decreasing and the numeric values of a CDF representation should be monotonically increasing. Failure to satisfy these requirements generates an Undefined result.

Any numeric values for the hazard representation of mortality should be between 0 and 1 inclusive. Failure to satisfy this requirement generates an Undefined result.

Any numeric values for the probability representation of mortality should be between 0 and 1 and should sum to 1. Failure to satisfy either of these requirements generates an Undefined result.

ResourceFunction["MortalityConvert"] only works on discrete distributions and it assumes the time intervals between elements of the supplied vector are the same.

Convert a description of mortality using "Hazard" into an equivalent description using "Survival":

In[1]:= |

Out[1]= |

Convert the previous description of mortality using "Survival" into an equivalent description using "Probability":

In[2]:= |

Out[2]= |

Convert the previous description of mortality using "Probability" into an equivalent description using a cumulative distribution function (CDF):

In[3]:= |

Out[3]= |

Convert the previous description of mortality using a cumulative distribution function into an equivalent description using "Hazard" (returning, thereby, to the original input):

In[4]:= |

Out[4]= |

If a symbolic vector is used as input, a conditional expression is generated:

In[5]:= |

Out[5]= |

The vector may be purely symbolic:

In[6]:= |

Out[6]= |

Conversions from one description to the same description return the original data:

In[7]:= |

Out[7]= |

If an impossible vector is used as input, the result is Undefined:

In[8]:= |

Out[8]= |

Unlisted representations (e.g. from spelling errors) generate a $Failed and an explanatory error message:

In[9]:= |

Out[9]= |

Compute the expected value of death benefits with a mortality table given as a survival vector and a 100% interest rate, which is equivalent to a 50% discount rate:

In[10]:= |

Out[10]= |

Do the same computation using TimeValue and interest rates:

In[11]:= |

Out[11]= |

Compute the expected value of a premium of $1 paid at the beginning of each year the person is alive with a mortality table given as a hazard vector and a 100% interest rate:

In[12]:= |

Out[12]= |

Compute the premium required to set the expected value of premiums equal to the expected value of death benefits given mortality stated in different ways:

In[13]:= |

Out[13]= |

Compute the prospective reserve on an insurance policy at time *z* for which the insurer receives the same premium each year so long as the insured is alive, such that at the outset of the policy the expected time value of the premiums are equal to the expected time value of the death benefits:

In[14]:= |

In[15]:= |

In[16]:= |

Out[16]= |

An insurer pays if risk 1 first materializes at time *x* and pays if risk 2 first materializes at time *y*, where the materialization of the risks are independent and the distribution of time at which either materializes is given as a list of hazard probabilities. Compute the expected present value of the insurer’s payout, assuming a 5% interest rate:

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

In[19]:= |

Out[19]= |

- 1.0.0 – 08 August 2019

This work is licensed under a Creative Commons Attribution 4.0 International License