model_error_single | R Documentation |
Calculates the root mean square error or mean absolute error of
univariate models estimated by the function model_fcast
or
model_est_single
.
model_error_single(k, y, lags, h, RMSE = TRUE)
k |
An integer to determine the number of observations to include in the out-of-sample set. |
y |
A numeric vector or time series of the dependet variable; tipplically the headline inflation. |
lags |
A data frame generated by the function |
h |
An integer to set the desired horizon. |
RMSE |
Logical: if |
An integer contaning the calculated error.
model_est_single
, model_best
,
model_fcast
.
inf_head <- coreinf_br[["ipca"]]
pq <- lags(2, 1)
purrr::map_dbl(1:12, ~ model_error_single(24, inf_head, unique(pq[, 1:2]), .x, RMSE = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.