Compute quality criteria for asymmetric filters
Source:R/get_properties_function.R
diagnostic_matrix.RdFunction du compute a diagnostic matrix of quality criteria for asymmetric filters
Arguments
- x
moving_averageobject or weights of the asymmetric filter (from -lags to m).- lags
Lags of the filter (should be positive), only used if
xis not amoving_average.- passband
passband threshold.
- sweights
Weights of the symmetric filter (from 0 to lags or -lags to lags). If missing, the criteria from the functions
mseare not computed.- ...
optional arguments to
mse.
Details
For a moving average of coefficients \(\theta=(\theta_i)_{-p\le i\le q}\)
diagnostic_matrix returns a list with the following ten criteria:
b_cConstant bias (if \(b_c=0\), \(\theta\) preserve constant trends) $$\sum_{i=-p}^q\theta_i - 1$$b_lLinear bias (if \(b_c=b_l=0\), \(\theta\) preserve constant trends) $$\sum_{i=-p}^q i \theta_i$$b_qQuadratic bias (if \(b_c=b_l=b_q=0\), \(\theta\) preserve quadratic trends) $$\sum_{i=-p}^q i^2 \theta_i$$F_gFidelity criterium of Grun-Rehomme et al (2018) $$$$S_gSmoothness criterium of Grun-Rehomme et al (2018)T_gTimeliness criterium of Grun-Rehomme et al (2018)A_wAccuracy criterium of Wildi and McElroy (2019)S_wSmoothness criterium of Wildi and McElroy (2019)T_wTimeliness criterium of Wildi and McElroy (2019)R_wResidual criterium of Wildi and McElroy (2019)
References
Grun-Rehomme, Michel, Fabien Guggemos, and Dominique Ladiray (2018). “Asymmetric Moving Averages Minimizing Phase Shift”. In: Handbook on Seasonal Adjustment.
Wildi, Marc and McElroy, Tucker (2019). “The trilemma between accuracy, timeliness and smoothness in real-time signal extraction”. In: International Journal of Forecasting 35.3, pp. 1072–1084.
Examples
filter <- lp_filter(horizon = 6, kernel = "Henderson", endpoints = "LC")
sweights <- filter[, "q=6"]
aweights <- filter[, "q=0"]
diagnostic_matrix(aweights, sweights = sweights)
#> b_c b_l b_q F_g S_g
#> -1.110223e-16 -4.066279e-01 -2.160733e+00 3.878572e-01 1.272295e+00
#> T_g A_w S_w T_w R_w
#> 3.034079e-02 1.507927e-02 5.251704e-01 5.226739e-02 3.105944e-01