TOPALS_fit: TOPALS fitting function for mortality schedules (by Carl...

View source: R/TOPALS_fit.R

TOPALS_fitR Documentation

TOPALS fitting function for mortality schedules (by Carl Schmertmann)

Description

Fits TOPALS parameters to single-year or age-group (D,N) data by penalized IRLS with analytical derivatives.

Usage

TOPALS_fit(
  N,
  D,
  std,
  age_group_bounds = 0:100,
  knot_positions = c(0, 1, 10, 20, 40, 70),
  penalty_precision = 2,
  max_iter = 50,
  alpha_tol = 5e-05,
  details = FALSE
)

Details

  • added fitted log mort, basis, etc to detailed output

  • added ability to fit age-grouped as well as single-yr data

  • changed fitting algorithm from Newton-Raphson to (penalized) IRLS age_group_bounds is a (G+1) vector of ages v that define G closed age groups [v1,v2), [v2,v3)... [vG,vG+1) For ex. if age_group_bounds = c(0,1,5,10,15,...,90) then the age groups are [0,1), [1,5), [5,10), ..., [85,90) A more complete explanation is in https://github.com/schmert/TOPALS/blob/master/TOPALS_fitting_with_grouped_data.pdf


albinomatheus/toolbox documentation built on June 13, 2024, 5:42 a.m.