Description Usage Arguments Details Value See Also Examples
This function estimates a direct least square horizon-specific model.
1 2 3 4 5 6 7 8 9 10 11 |
df |
A data frame. The first column of the data frame
must be the base variable for constructing the
dependent variable, the multiperiod ahead
value to be forecasted, x_{t + h}. If |
lags |
An integer vector defining the lags of the
regressors. If |
.h |
h step-ahead. |
ic |
Information criterion, |
.var |
A string to determine how the model will be
specificated: |
.diff |
Logical |
wav |
Logical. If |
xreg |
Data frame. Exogeunous variable not subjected
to be lagged. The number of rows must be the same as in |
... |
Further arguments passed to |
General OLS regression model is writting as:
x_{t + h} = α + \mathbf{{β}}'\mathbf{x}_t + \mathbf{{γ}}'\mathbf{z}_t + \mathbf{{θ}}'\mathbf{d}_t + ε_{t + h},
where variables are explained in wavdrcast-package
details
section. Arguments .var, .diff
and wav
allow one to
estimate subsets of this general model,
as discussed in wavdrcast-package
. If
.var = "all"
, the general model is estimated (unless
xreg = NULL
, so that \mathbf{d} is out). If
.var = "ar"
, \mathbf{z} terms are excluded
(not \mathbf{d}, if included). Finally, if
.var = "ar_out"
, the model is estimated without
\mathbf{x} regressors.
A list with the following elements:
A tibble with the data regressors used to run the
model choosed by the information criterion. This can be
a different data set from that one returned by the lm
object.
An object of class lm
.
1 2 3 4 5 6 | model(df = inf, lags = c(2, 0), .h = 2, .var = "ar")
model(df = inf, lags = c(2, 2), .h = 2)
model(df = inf[1], lags = c(2, 2), .h = 2, wav = TRUE)
model(df = gdp, lags = c(2, 2), .h = 2, .diff = TRUE)
model(df = gdp[1], lags = c(2, 2), .h = 2, .diff = TRUE, wav = TRUE)
model(df = gdp[1], lags = c(0, 0), .h = 2, .diff = TRUE, wav = TRUE, .var = "ar_out")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.