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::loess (Local Polynomial Regression Fitting), adapted to univariate forecasting in ahead::loessf.

Currently for this model (as of 2023-08-28), for uncertainty quantification, options are:

  • Independent bootstrap of the residuals
  • Multivariate circular block bootstrap of the residuals
  • Multivariate moving block bootstrap of the residuals
  • Adjustment of a copula to the residuals
  • More options to come in the future.

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

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(datasets)

ahead::loessf on Nile dataset

plot(loessf(Nile, h=20, 
            type_pi = "bootstrap",
            type_aggregation = "mean",
            level=95, B=10))

plot(loessf(Nile, h=20, 
            type_pi = "bootstrap",
            type_aggregation = "median",
            level=95, B=10))

plot(loessf(Nile, h=20, 
            type_pi = "blockbootstrap",
            type_aggregation = "mean",
            level=95, B=10))

plot(loessf(Nile, h=20, 
            type_pi = "blockbootstrap",
            type_aggregation = "median",
            level=95, B=10))