model_error_single: Error Prediction Single Variable

model_error_singleR Documentation

Error Prediction Single Variable

Description

Calculates the root mean square error or mean absolute error of univariate models estimated by the function model_fcast or model_est_single.

Usage

model_error_single(k, y, lags, h, RMSE = TRUE)

Arguments

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 lags.

h

An integer to set the desired horizon.

RMSE

Logical: if TRUE returns RMSE, if FALSE returns MAE.

Value

An integer contaning the calculated error.

See Also

model_est_single, model_best, model_fcast.

Examples

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))

nelson16silva/wavcoreinf documentation built on Feb. 17, 2025, 7:10 p.m.