Accuracy/smoothness/timeliness criteria through spectral decomposition
Source:R/fst_filters.R
mse.Rd
Accuracy/smoothness/timeliness criteria through spectral decomposition
Usage
mse(aweights, sweights, density = c("uniform", "rw"), passband = pi/6, ...)
Arguments
- aweights
moving_average
object or weights of the asymmetric filter (from -n to m).- sweights
moving_average
object or weights of the symmetric filter (from 0 to n or -n to n).- density
hypothesis on the spectral density:
"uniform"
(= white woise, the default) or"rw"
(= random walk).- passband
passband threshold.
- ...
other unused arguments.
References
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"]
mse(aweights, sweights)
#> accuracy smoothness timeliness residual
#> 0.008306348 0.449956378 0.061789932 0.299548665
# Or to compute directly the criteria on all asymmetric filters:
mse(filter)
#> q=6 q=5 q=4 q=3 q=2
#> accuracy 6.024615e-31 3.003396e-04 0.0022730023 0.0036954760 0.0010393071
#> smoothness 2.495366e-32 1.387928e-03 0.0049316361 0.0056152618 0.0181979732
#> timeliness 3.783119e-31 5.977841e-05 0.0001510595 0.0001125956 0.0007184473
#> residual -4.091914e-31 1.363420e-03 0.0051414956 0.0049053853 0.0144907081
#> q=1 q=0
#> accuracy 0.0009371065 0.008306348
#> smoothness 0.1382592159 0.449956378
#> timeliness 0.0105376169 0.061789932
#> residual 0.0756650916 0.299548665