Dspline_fit: D-Splines fitting function for mortality schedules (by Carl...

View source: R/D-Splines_fit.R

Dspline_fitR Documentation

D-Splines fitting function for mortality schedules (by Carl Schmertmann)

Description

Fits parameters to single-year or age-group (D,N)

Usage

Dspline_fit(
  N,
  D,
  age_group_lower_bounds = 0:99,
  age_group_upper_bounds = 1:100,
  Amatrix,
  cvector,
  SIGMA.INV,
  knots = seq(from = 3, to = 96, by = 3),
  max_iter = 20,
  theta_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.