Learn R Programming

MARX (version 0.2)

forecast.marx: Forecasting function for the MARX model

Description

This function allows you to forecast with the mixed causal-noncausal model with possibly exogenous regressors.

Usage

forecast.marx(y, X, p_C, p_NC, X.for, h, M, N)

Arguments

y

Data vector y.

X

(optional) Matrix with data (column represent a series).

p_C

Number of lags (causal order).

p_NC

Number of leads (noncausal order).

X.for

(optional) Matrix with forecasted values for X (column represents series).

h

Forecast horizon h.

M

(optional) Truncation value M for MA representation. Default value: 50.

N

(optional) Number of simulations to forecast noncausal component. Default: 10,000.

Value

y.for

Vector containing forecasted values for y.

Examples

Run this code
# NOT RUN {
## Forecasting MAR(0,1) model 4-periods ahead for lnbev (from dataset)
data <- MARX::dataset[,2]
y.for <- forecast.marx(y=data, p_C=0, p_NC=1, h=4, M=50, N=1000)
# }

Run the code above in your browser using DataLab