Learn R Programming

dLagM (version 0.0.8)

polyDlmForecast: Compute forecasts for polynomial distributed lag model

Description

A function that computes forecasts for polynomial distributed lag model with one predictor.

Usage

polyDlmForecast(model , x , h = 1)

Arguments

model

An object of class lm including the fitted model with poly.dlm() function.

x

A vector including the new observations of independent time series. This is not restricted to ts objects.

h

The number of ahead forecasts.

Value

forecasts

A vector including forecasts.

Details

This function directly uses the model formula and estimates of model coefficients to find forecast one-by-one starting from the one-step ahead forecast.

Examples

Run this code
# NOT RUN {
data(warming)
model.poly = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
q = 2 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
polyDlmForecast(model = model.poly , x = c(95, 98) , h = 1)
# }

Run the code above in your browser using DataLab