ahead | Star

PyPI PyPI - License Downloads Last Commit

Welcome to ahead's (Python version) website.

ahead is a package for univariate and multivariate time series forecasting. The Python version is built on top of the R package with the same name. ahead's source code is available on GitHub.

Currently, 6 forecasting methods are implemented in the Python package:

  • DynamicRegressor: univariate time series forecasting method adapted from forecast::nnetar. The Python implementation contains only the automatic version.
  • EAT: univariate time series forecasting method based on combinations of R's forecast::ets, forecast::auto.arima, and forecast::thetaf
  • ArmaGarch: univariate time series forecasting simulation based on ARMA(1, 1)-GARCH(1,1)
  • BasicForecaster: multivariate time series forecasting methods; mean, median and random walk
  • Ridge2Regressor: multivariate time series forecasting method, based on quasi-randomized networks and presented in this paper
  • VAR: multivariate time series forecasting method using Vector AutoRegressive model (VAR, mostly here for benchmarking purpose)

Looking for a specific function? You can also use the search function available in the navigation bar.

Installing

  • From Pypi, stable version:
pip install ahead
  • From Github, for the development version:
pip install git+https://github.com/Techtonique/ahead.git

Quickstart

Univariate time series

import pandas as pd
from ahead import DynamicRegressor

# Data frame containing the time series 
dataset = {
'date' : ['2020-01-01', '2020-02-01', '2020-03-01', '2020-04-01', '2020-05-01'],
'value' : [34, 30, 35.6, 33.3, 38.1]}

df = pd.DataFrame(dataset).set_index('date')
print(df)

# univariate time series forecasting 
d1 = DynamicRegressor(h = 5)
d1.forecast(df)
print(d1.result_df_)

Multivariate time series

import pandas as pd
from ahead import Ridge2Regressor

# Data frame containing the (3) time series
dataset = {
 'date' : ['2001-01-01', '2002-01-01', '2003-01-01', '2004-01-01', '2005-01-01'],
 'series1' : [34, 30, 35.6, 33.3, 38.1],    
 'series2' : [4, 5.5, 5.6, 6.3, 5.1],
 'series3' : [100, 100.5, 100.6, 100.2, 100.1]}
df = pd.DataFrame(dataset).set_index('date')

# multivariate time series forecasting 
r1 = Ridge2Regressor(h = 5)
r1.forecast(df)
print(r1.result_dfs_)

Documentation

For univariate models

For multivariate models

Contributing

Want to contribute to ahead's development on Github, read this!