This function uses the first d components of the singular value
decomposition in order to approximate a vector of model residuals by a
sum of d multiplicative terms, with the multiplicative
structure determined by two specified factors follows the SVD function by Turner et al. (2023).
For glm and gnm models from the gnm R-packages,
the matrix entries are weighted working residuals. The primary use of residSVD is to
generate good starting values for the parameters in Mult terms
in models to be fitted using gnm. In this case, we modified the function
in order to obtain good starting values for the multi-population mortality models.
residSVD2(model, fac1, fac2, d = 1)If d = 1, a numeric vector; otherwise a numeric matrix with d columns.
Turner, H., & Firth, D. (2023). Generalized nonlinear models in R: An overview of the gnm package. R package version 1.1-5. https://CRAN.R-project.org/package=gnm
fitLCmulti, forecast.fitLCmulti
multipopulation_cv, plot.fitLCmulti
plot.forLCmulti