plot.mtsforecast: Plot multivariate time series forecast or residuals

View source: R/plot.R

plot.mtsforecastR Documentation

Plot multivariate time series forecast or residuals

Description

Plot multivariate time series forecast or residuals

Usage

## S3 method for class 'mtsforecast'
plot(x, selected_series, type = c("pi", "dist", "sims"), level = 95, ...)

Arguments

x

result from basicf, ridge2f or varf (multivariate time series forecast)

selected_series

name of the time series selected for plotting

type

"pi": basic prediction intervals; "dist": a distribution of predictions; "sims": the simulations

level

confidence levels for prediction intervals

...

additional parameters to be passed to plot or matplot

Examples


require(fpp)

fit_obj_VAR <- ahead::varf(fpp::insurance, lags = 2,
h = 10, level = 95)

fit_obj_ridge2 <- ahead::ridge2f(fpp::insurance, lags = 2,
h = 10, level = 95)

par(mfrow=c(2, 2))
plot(fit_obj_VAR, "Quotes")
plot(fit_obj_VAR, "TV.advert")
plot(fit_obj_ridge2, "Quotes")
plot(fit_obj_ridge2, "TV.advert")

obj <- ahead::ridge2f(fpp::insurance, h = 10, type_pi = "blockbootstrap",
block_length=5, B = 10)
par(mfrow=c(1, 2))
plot(obj, selected_series = "Quotes", type = "sims",
main = "Predictive simulation for Quotes")
plot(obj, selected_series = "TV.advert", type = "sims",
main = "Predictive simulation for TV.advert")


par(mfrow=c(1, 2))
plot(obj, selected_series = "Quotes", type = "dist",
main = "Predictive simulation for Quotes")
plot(obj, selected_series = "TV.advert", type = "dist",
main = "Predictive simulation for TV.advert")



Techtonique/ahead documentation built on Nov. 24, 2024, 10:33 a.m.