Skip to content

Extension of the R package 'tsForecastR'. Enables to process time series in parallel.

License

Notifications You must be signed in to change notification settings

xavierkamp/parTsForecastR

Repository files navigation

lifecycle Travis build status AppVeyor build status Codecov test coverage

Time Series Forecasting with Parallel Processing

This package is an extension of the tsForecastR package. It uses a parallel processing framework to speed up forecast generation when multiple independent time series are present. To see the more details on the forecasting procedure, please inspect the tsForecastR package.

All codes are written in R.

Getting Started

Prerequisites

Install R: https://cloud.r-project.org/

Install RStudio: https://rstudio.com/products/rstudio/download/

For Windows, also install Rtools: https://cran.r-project.org/bin/windows/Rtools/

Install

install.packages("devtools")
library("devtools")
devtools::install_github("xavierkamp/parTsForecastR")

Dependency

This package requires the R package 'tsForecastR'.

Function

generate_fc_par : Function which enables the user to select different forecasting algorithms ranging from traditional time series models (i.e. ARIMA, ETS, STL) to machine learning methods (i.e. LSTM, AutoML).

Example:

library(datasets)

ts_data <- stats::ts(seq(1:144), start = c(1949, 1), frequency = 12)
mts_data <- cbind(ts_data, AirPassengers)

library(parTsForecastR)
# Generate forecasts on twelve periods
fc <- generate_fc_par(mts_data,
                      fc_horizon = 12)
df <- tsForecastR::save_as_df(fc)
print(df)

# Generate forecasts on past data with a rolling window and six iterations
fc <- generate_fc_par(mts_data,
                      model_names = "arima",
                      fc_horizon = 12,
                      backtesting_opt = list(use_bt = TRUE,
                                             nb_iters = 6))
df <- tsForecastR::save_as_df(fc)
print(df)

About

Extension of the R package 'tsForecastR'. Enables to process time series in parallel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages