Skip to content

Class that estimates parameters for the CH function

License

Notifications You must be signed in to change notification settings

chiheem/CH-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CH-function

This code provides a class to estimate the CH function as presented in the following paper:

Wong, Chi Heem, and Albert K. Tsui. "Forecasting life expectancy: Evidence from a new survival function." Insurance: Mathematics and Economics 65 (2015): 208-226.

Please cite the paper if you used this code in your work!

Dependent packages

  • numpy (tested on 1.18.5)
  • matplotlib (tested on 3.1.0)
  • scipy (tested on 1.14)

Example usage

sx = [1, 0.9, 0.889, 0.858, 0.813, 0.739, 0.617, 0.421, 0.181, 0.0278, 0.011, 0.000001]
ages = [x*10 for x in range(11)]
df = pd.DataFrame(list(zip(sx, ages)), columns =['Sx', 'Age'])

chf = CHFitter()
chf.fit(df, 'Sx', 'Age', plot_fit=True)
chf.print_summary()

About

Class that estimates parameters for the CH function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages