Type: Package
Title: Fitting of Hybrid ARMA-LSTM Models
Description: The real-life time series data are hardly pure linear or nonlinear. Merging a linear time series model like the autoregressive moving average (ARMA) model with a nonlinear neural network model such as the Long Short-Term Memory (LSTM) model can be used as a hybrid model for more accurate modeling purposes. Both the autoregressive integrated moving average (ARIMA) and autoregressive fractionally integrated moving average (ARFIMA) models can be implemented. Details can be found in Box et al. (2015, ISBN: 978-1-118-67502-1) and Hochreiter and Schmidhuber (1997) <doi:10.1162/neco.1997.9.8.1735>.
Author: Debopam Rakshit [aut, cre], Ritwika Das [aut], Dwaipayan Bardhan [aut]
Maintainer: Debopam Rakshit <rakshitdebopam@yahoo.com>
Version: 0.1.0
Encoding: UTF-8
License: GPL-3
Imports: rugarch, tseries, tensorflow, keras, reticulate
NeedsCompilation: no
RoxygenNote: 7.3.1
Packaged: 2024-02-27 17:36:09 UTC; Debopam
Repository: CRAN
Date/Publication: 2024-02-28 18:30:11 UTC

Hybrid ARMA-LSTM Model for Time Series Forecasting

Description

The linear ARMA model is fitted to the time series. The significant number of PACF values of ARMA residuals are considered as the lag. The LSTM model is fitted to the ARMA residuals setting the lag value as the time step. User needs to install keras, tensorflow and reticulate packages as the prerequisite to implement this package.

Usage

ARMA.LSTM(X, p, q, arfima = FALSE, dist.model= "ged", out.sample, LSTM.units,
ACTIVATION.function = "tanh", DROPOUT = 0.2, Optimizer ="adam", Epochs = 100,
LSTM.loss = "mse", LSTM.metrics = "mae")

Arguments

X

A univariate time series data

p

Order of AR

q

Order of MA

arfima

Whether to include arfima (0<d<0.5)

dist.model

The distribution density to use for the innovation. The default distribution for the mean model used is "ged". Other choices can be obtained from the rugarch package.

out.sample

A positive integer indicating the number of periods before the last to keep for out of sample forecasting. To be considered as test data.

LSTM.units

Number of units in the LSTM layer

ACTIVATION.function

Activation function

DROPOUT

Dropout rate

Optimizer

Optimizer used for optimization of the LSTM model

Epochs

Number of epochs of the LSTM model

LSTM.loss

Loss function

LSTM.metrics

Metrics

Value

References

Examples


y<-c(5,9,1,6,4,9,7,3,5,6,1,8,6,7,3,8,6,4,7,5)
my.hybrid<-ARMA.LSTM(y, p=1, q=0, arfima=FALSE, dist.model = "ged",
out.sample=10, LSTM.units=50, ACTIVATION.function = "tanh",
DROPOUT = 0.2, Optimizer ="adam", Epochs = 10, LSTM.loss = "mse", LSTM.metrics = "mae")