wcore_summary_best: Choose Best Wavelet Model

View source: R/summary.R

wcore_summary_bestR Documentation

Choose Best Wavelet Model

Description

wcore_summary_best chooses the wavelet models that are the most favorable ones in terms of statistics calculated by the function wcore_summary_fcast.

Usage

wcore_summary_best(x, d = c(1, 1, 1, 1, 1))

Arguments

x

A tibble from wcore_summary_fcast.

d

A vector of weigths. These weigths stand for standard deviation, moving avarage, no bias, dynamic adjustment and forecast error, respectively.

Details

Criteria variables that are in input x are normalized to the interval [0, 1]. Given d, the function wcore_summary_best returns the model in which the sum of criteria is minimal. When the criterion is p-value, as in no bias, the normalization is (1 - "p-value").

The motivation for this function is that a good core inflation should possess desirable statistical features. Some of them are captured in wcore_summary_best. A good core inflation should have low standard deviation, capture trend inflation (moving avarage), not be biased, have dynamic consistency, and should help to predict headline inflation.

Value

A tibble with the best models. If more than one wavelet specification have the same statistics, all these models are presented in the tibble.

References

Silva Filho, Tito N. Teixeira da, & Figueiredo, Francisco Marcos Rodrigues. (2011). Has core inflation been doing a good job in Brazil?. Revista Brasileira de Economia, 65(2), 207-233.

Yash P. Mehra & Devin Reilly, 2009. "Short-term headline-core inflation dynamics," Economic Quarterly, Federal Reserve Bank of Richmond, issue Sum, pages 289-313.

Examples

library(lubridate)

wshr_obj <- wav_args_wshr(list(
wavelet = c("haar", "d4", "d6", "d8", "s8"),
n.level = 1:4
))

inf_head <- coreinf_br[["ipca"]]

date_start <- coreinf_br[["date"]][1]
ts_start <- c(year(date_start), month(date_start))
inf_head_ts <- ts(inf_head, start = ts_start, frequency = 12)

core_wavelet <- wav_smooth(inf_head, wshr_obj)
core_wavelet2 <- wcore_table(core_wavelet, inf_head_ts)

# A more realistic estimation of the forecasting
# error could have h and k greather than 2 and 6.

err_wcore <- error_wave_summary(h = 2, x = wshr_obj,
                                y = inf_head, lags = lags(2,1),
                                k = 6, RMSE = TRUE)

wavcore_smry <- wcore_summary_fcast(inf_head, core_wavelet2, err_wcore)

wcore_summary_best(wavcore_smry)

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