Learn R Programming

demography (version 2.0)

residuals.fdm: Compute residuals and fitted values from functional demographic model or Lee-Carter model

Description

After fitting a Lee-Carter model or functional demographic model, it is useful to inspect the residuals or plot the fitted values. These functions extract the relevant information from the fit object.

Usage

# S3 method for fdm
residuals(object, ...)

# S3 method for fdm fitted(object, ...)

# S3 method for lca fitted(object, ...)

# S3 method for lca residuals(object, ...)

Value

residuals.fdm and residuals.lca produce an object of class “fmres” containing the residuals from the model.

fitted.fdm and fitted.lca produce an object of class

“fts” containing the fitted values from the model.

Arguments

object

Output from fdm or lca.

...

Other arguments.

Author

Rob J Hyndman.

See Also

fdm, lca, bms

Examples

Run this code
  fit1 <- lca(fr.mort)
  plot(residuals(fit1))
  plot(fitted(fit1))

Run the code above in your browser using DataLab