model_error_wave_single | R Documentation |
model_error_wave_single
estimates the prediction
error of models fitted by the
function model_est
when the x
variable is
y
smoothed by wavelet models. For each new observation
k
inlucluded in the out-of-sample set,
the wavelet-based signal is reestimated.
This function computes
the prediction error for a single wavelet specification and
therefore is similar to model_error_wave
that is used for computing the error for several specifications of
wavelet models.
model_error_wave_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 a time series for wavelet-based signal estimation. Headline inflation for estimation of a wavelet core inflation measure. |
lags |
A data frame generated by the function |
h |
An integer to set the desired horizon. |
RMSE |
logical: if |
... |
Additional parameters to pass to function |
A numeric vector of length one.
smooth_wavelet, model_error_wave
,
model_fcast, model_best, model_est
inf_head <- coreinf_br[["ipca"]]
pq <- lags(2, 1)
# h = 2
model_error_wave_single(
36, inf_head, pq, 2, RMSE = FALSE,
thfun = ebayesthresh.wavelet,
wtfun = "dwt",
wtfunlist = list(wf = "d6", n.levels = 4),
a = 0.5, vscale = "level", prior = "cauchy")
# h = 1:6; k = 20
purrr::map_dbl(1:6, ~ model_error_wave_single(
20, inf_head, pq, .x, RMSE = FALSE,
thfun = ebayesthresh.wavelet,
wtfun = "dwt",
wtfunlist = list(wf = "d6", n.levels = 4),
a = 0.5, vscale = "level", prior = "cauchy"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.