The smoothAPC package implements smoothing of demographic data. The method uses bivariate thin plate splines, bivariate lasso-type regularization, and allows for both period and cohort effects. Thus the mortality rates are modelled as the sum of four components: a smooth bivariate function of age and time, smooth one-dimensional cohort effects, smooth one-dimensional period effects and random errors.
The methods are described in Dokumentov, A., and Hyndman, R.J. (2014) Bivariate data with ridges: two-dimensional smoothing of mortality rates.
Authors: Alex Dokumentov and Rob J Hyndman
library(smoothAPC) library(demography) m <- log(fr.mort$rate$female[1:30, 150:160]) sm <- smoothAPC(m, lambdaaa = 0.2, lambdayy = 0.1, lambdaay = 0.4, effects = FALSE) plot3d(sm)
This package is free and open source software, licensed under GPL (>= 2).