lca
produces a standard Lee-Carter model by default, although many
other options are available. bms is a wrapper for
lca and returns a model based on the
Booth-Maindonald-Smith methodology.lca(data, series=names(data$rate)[1], years=data$year,
ages=data$age, max.age=100,
adjust = c("dt", "dxt", "e0", "none"), chooseperiod=FALSE,
minperiod=20, breakmethod=c("bai","bms"), scale = FALSE,
restype = c("logrates", "rates", "deaths"), interpolate = FALSE)
bms(data, series=names(data$rate)[1], years=data$year,
ages=data$age, max.age=100,
minperiod = 20, breakmethod = c("bms", "bai"), scale = FALSE,
restype = c("logrates", "rates", "deaths"), interpolate = FALSE)max.age.breakpoints in the strucchange package)
and data object.data object.data. It takes the name given by the series argument.data$rate. Each row is one age group
(assumed to be single years). Each column is one year. The
function produces a model for the series mortality rate matrix
within data$rate. Forecasts from this model can be obtained using forecast.lca.forecast.lca, fdmfrance.LC1 <- lca(fr.mort,adjust="e0")
plot(france.LC1)
par(mfrow=c(1,2))
plot(fr.mort,years=1953:2002,ylim=c(-11,1))
plot(forecast(france.LC1,jumpchoice="actual"),ylim=c(-11,1))
france.bms <- bms(fr.mort,breakmethod="bai")
fcast.bms <- forecast(france.bms)
par(mfrow=c(1,1))
plot(fcast.bms$kt)Run the code above in your browser using DataLab