Hi,
In fpp3 12.3 Vector autoregressions | Forecasting: Principles and Practice (3rd ed) , I'd like to generate VAR and VECM forecasts, dynamic and static.
Questions (multivariate):
-
Graphs: how do I
(a) change the ordering of each series in a multi-graph ,
(b) generate plots and extract information for 1 series only? -
accuracy measures:
(a) Are the forecast standard error formulae the same as for the univariate case? I have computed those in other packages and they are different, but not very much.
(b) Is CRPS supported for multivariate distributions e.g. is CRPS correct in the example below? Is Winkler score the only accuracy measure not supported? -
I can generate rolling static one-step ahead forecasts in the univariate model,
stretch_tsibble
5.10 Time series cross-validation | Forecasting: Principles and Practice (3rd ed) (or with a loop in base R). How do I generate rolling one-step ahead static forecasts with PI's, in multivariate VAR and VECM? -
In VECM how do I include more than 1 ECT, or are they automatically selected based on lambda trace statistics? Also, if I want to check equivalence (as per theory): VAR-in-levels vs. the differenced series + a full-set of ECT's.
Here's a VAR example using fpp3 data generating dynamic OOS forecast with accuracy measures.
#===============================
library(fpp3)
library(patchwork)
#===============================
# set parameters
start <- make_yearquarter(year = 1970L, quarter = 1L, fiscal_start = 1)
begin <- make_yearquarter(year = 2019L, quarter = 2L, fiscal_start = 1) - 10
end <- make_yearquarter(year = 2019L, quarter = 2L, fiscal_start = 1)
tsb <- us_change |> filter(Quarter >= start & Quarter <= begin)
tsb
fit <- tsb |>
model(
aicc = VAR(vars(Consumption, Income)),
bic = VAR(vars(Consumption, Income), ic = "bic")
)
fit
glance(fit)
fc <- fit |>
select(aicc) |> # <VAR(5) w/ mean>
forecast(h = 11)
fc |>
autoplot(us_change |> filter(year(Quarter) > 2010))
# dynamic forecasts loss measures & distributional accuracy
fc_accuracy <-
fc |>
accuracy(us_change,
measures = list(point_accuracy_measures,
interval_accuracy_measures,
distribution_accuracy_measures))
fc_accuracy
thanks,
Amarjit