model_est | R Documentation |
Given y
and xreg
, this function estimates a direct forecasting model as
described below, in section "Details".
model_est(y, xreg, h, lags)
y |
A numeric vector or time series. |
xreg |
A numeric vector for the exogenous variable. |
h |
An integer. The horizon of prediction. |
lags |
A data frame generated by the function |
Condiser the following regression:
y_{i,t+h} = a_0 + y_{i,t + 1 - pstart} + ... + y_{i,t + 1 - pend} + x_{i,t + 1 - qstart} + ... + x_{i,t + 1 - qend} + e_{i,t + h}
.
model_est
estimates the above regression for all indexes in the
data frame lags
(p_start
\ge 1
and q_start
\ge 1
). Forecasting from a model with this
structure is called direct forecast, where h
denotes the horizon over which y
is to be forecast. This
approach can be used to forecast several steps ahead.
A measure of core inflation (\pi^*
) should
improve forecasting of headline inflation (\pi
). A way of test
this property is running a regression like that one above:
\pi_{t+h} = \alpha_0 + \sum_{i = 1}^p\beta_i\pi_{t-i+1} +
\sum_{i = 1}^q\gamma_i\pi^*_{t-i+1} e_{t + h}
.
Using recursive = FALSE
(default) in function lags
is
equivalent to estimate the previous equation for headline inflation.
If recursive = TRUE
,
i
is not necessarily initiated in 1, i.e, p_start
and q_start
also changes in
the first equation. Allowing p_start
and q_start
to vary,
there are more models to be estimated because it opens up
a lot of new possibilities.
A list with following components:
model |
A |
n_obs |
Number of observations of |
h |
The horizon from which y is being forecasted. |
model_est_single
model_fcast
inf_head <- coreinf_br[["ipca"]]
inf_corems <- coreinf_br[["ipcams"]]
pq <- lags(2, 1)
model_est(inf_head, inf_corems, 2, pq)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.