wcore_best_est: Summarize Statistics of the Models by Group

View source: R/summary.R

wcore_best_estR Documentation

Summarize Statistics of the Models by Group

Description

This function calculates some statistics about wavelet core inflation measure by group.

Usage

wcore_best_est(x, y, group)

Arguments

x

An objetct generated by the functions wcore_summary, wcore_summary_fcast or wcore_summary_best.

y

A numeric vector (headline inflation) that must be the same x used in wav_smooth.

group

A groupping variable representing a parameter used to compute wavelet-based signal estimation that must be presenting in the object x.

Value

A tibble. The fist column is the groupping variable. The other columns are:

mean2

Mean of the wavelet core inflation.

max

Maximun value of the wavelet core inflation.

min

Maximun value of the wavelet core inflation.

sd2

Standard desviation.

cv

Coeficient of variation of the wavelet core inflation.

tmean

t-tests involving wavelet core inflation and headline inflation.

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)

x <- wcore_summary_best(wavcore_smry)

wcore_best_est(wavcore_smry, inf_head, wavelet)
wcore_best_est(x, inf_head, n.level)

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