ahead is a package for univariate and multivariate time series forecasting, with uncertainty quantification (R and Python).

The model used in this demo is stats::ridge2f.

Please remember that in real life, this model's hyperparameters will have to be tuned.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Install ahead

Here's how to install the R version of the package:

And here are the packages that will be used in this vignette:

library(ahead)
library(fpp)
library(ahead)
library(fpp)

Forecasting and plot predictions

obj <- ahead::ridge2f(fpp::insurance, h = 7, type_pi = "blockbootstrap", B = 10, 
                      block_length = 5)
plot(obj, selected_series = "Quotes", type = "sims", 
     main = "Predictive simulations \n for Quotes")
plot(obj, selected_series = "Quotes", type = "dist", 
     main = "Predictive simulation \n for Quotes")
plot(obj, selected_series = "TV.advert", type = "sims", 
     main = "Predictive simulation \n for TV.advert")
plot(obj, selected_series = "TV.advert", type = "dist", 
     main = "Predictive simulation \n for TV.advert")


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