Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

update

Updating functional demographic models and coherent functional demographic models.


Description

update.fmforecast() updates fdm forecasts. The argument object is the output from forecast.fdm which has been subsequently modified with new coefficient forecasts. These new forecasts are used when re-calculating the forecast of the mortality or fertility rates, or net migration numbers. update.fmforecast2() updates fdmpr forecasts. The argument object is the output from forecast.fdmpr which has been subsequently modified with new coefficient forecasts.

Usage

## S3 method for class 'fmforecast'
update(object, ...)

## S3 method for class 'fmforecast2'
update(object, ...)

Arguments

object

Output from either fdm or coherentfdm.

...

Extra arguments currently ignored.

Value

A list of the same class as object.

Author(s)

Rob J Hyndman.

See Also

Examples

## Not run: 
france.fit <- fdm(fr.mort,order=2)
france.fcast <- forecast(france.fit,50)
# Replace first coefficient model with ARIMA(0,1,2)+drift
france.fcast$coeff[[2]] <- forecast(Arima(france.fit$coeff[,2],
                                          order=c(0,1,2), include.drift=TRUE), h=50, level=80)
france.fcast <- update(france.fcast)

fr.short <- extract.years(fr.sm,1950:2006)
fr.fit <- coherentfdm(fr.short)
fr.fcast <- forecast(fr.fit)
par(mfrow=c(1,2))
plot(fr.fcast$male)
# Replace first coefficient model in product component with a damped ETS model:
fr.fcast$product$coeff[[2]] <- forecast(ets(fr.fit$product$coeff[,2], damped=TRUE),
                                        h=50, level=80)
fr.fcast <- update(fr.fcast)
plot(fr.fcast$male)

## End(Not run)

demography

Forecasting Mortality, Fertility, Migration and Population Data

v1.22
GPL (>= 2)
Authors
Rob J Hyndman with contributions from Heather Booth, Leonie Tickle and John Maindonald.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.