rmse_mae: Map RMSE and MAE by Combining Two Data Frames

View source: R/rmsemae.R

rmse_maeR Documentation

Map RMSE and MAE by Combining Two Data Frames

Description

rmse_mae is a functional to compute root mean square error and mean absolute error for all variables in a data frame with respect to all variables in another data frame. The number of rows of both data frames must be equal.

Usage

rmse_mae(dfa, dfb)

Arguments

dfa

A data frame of numeric vectors.

dfb

A data frame of numeric vectors. The number of rows of dfb must be equal to dfa.

Value

A data frame

Examples

# Measuring how far wavelet core inflation measures are
# from moving averages of headline inflation.

inf_head <- coreinf_br[["ipca"]]

mavc_order <- c(13, 25, 37)
names(mavc_order) <- paste0("mavc", mavc_order)
df_mavc <- purrr::map_df(mavc_order, ~mavc(x = inf_head, k = .))

corewav1 <- wmtsa::wavShrink(inf_head)
corewav2 <- wmtsa::wavShrink(inf_head, wavelet = "haar")
df_core <- tibble::tibble(corewav1, corewav2)

rmse_mae(df_core, df_mavc)

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