spedygiorgio / lifecontingencies

Financial and Actuarial Mathematics for Life Contingencies
Other
61 stars 29 forks source link

Test on axn, axyzn, and fix for Wolfgang's issue #8

Closed eschirmacher closed 8 years ago

eschirmacher commented 8 years ago

Hi Giorgio,

this pull request adds a few tests on life annuities and fixes the issue that Wolfgang Abele noticed on April 27, 2015 where the computation of a last survivor annuity yielded two different answers.

The issue was that the function axyzn ignored the very last term in the summation of v^k k_p_x.

I think that the definition of omega in the package is not consistent with the book Actuarial Mathematics (2nd Edition) page 63. Under observations point 4 says that s(x) > 0 for x < omega and s(x) = 0 for x >= omega.

I believe the R code sets omega equal to the last entry in the lifetable where l_x > 0.

Will probably need more testing of all functions.

Have a great weekend!

Ernesto

spedygiorgio commented 8 years ago

Thank you really very much, Ernesto. I have no words to express my gratitude

eschirmacher commented 8 years ago

You are very welcome!