0% found this document useful (0 votes)
11 views4 pages

TSLSTM

The 'TSLSTM' package provides a Long Short-Term Memory (LSTM) model for time series forecasting, utilizing a Recurrent Neural Network architecture based on Keras and TensorFlow. It includes functionalities for data preparation using Min-Max transformation and allows users to configure various parameters such as LSTM units, dropout rate, and loss function. The package outputs fitted values for training data and predicted values for test data, along with accuracy metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

TSLSTM

The 'TSLSTM' package provides a Long Short-Term Memory (LSTM) model for time series forecasting, utilizing a Recurrent Neural Network architecture based on Keras and TensorFlow. It includes functionalities for data preparation using Min-Max transformation and allows users to configure various parameters such as LSTM units, dropout rate, and loss function. The package outputs fitted values for training data and predicted values for test data, along with accuracy metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Package ‘TSLSTM’

October 12, 2022


Type Package
Title Long Short Term Memory (LSTM) Model for Time Series Forecasting
Version 0.1.0
Author Dr. Ranjit Kumar Paul [aut, cre],
Dr. Md Yeasin [aut]
Maintainer Dr. Ranjit Kumar Paul <[email protected]>
Description The LSTM (Long Short-Term Memory) model is a Recurrent Neural Net-
work (RNN) based architecture that is widely used for time series forecasting. Min-Max transfor-
mation has been used for data preparation. Here, we have used one LSTM layer as a sim-
ple LSTM model and a Dense layer is used as the output layer. Then, compile the model us-
ing the loss function, optimizer and metrics. This package is based on Keras and Tensor-
Flow modules and the algorithm of Paul and Garai (2021) <doi:10.1007/s00500-021-06087-4>.
License GPL-3
Encoding UTF-8
RoxygenNote 7.1.2
Imports keras, tensorflow, tsutils, stats
NeedsCompilation no
Repository CRAN
Date/Publication 2022-01-13 19:12:41 UTC

R topics documented:
ts.lstm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Index 4

1
2 ts.lstm

ts.lstm Long Short Term Memory (LSTM) Model for Time Series Forecasting

Description
The LSTM (Long Short-Term Memory) model is a Recurrent Neural Network (RNN) based archi-
tecture that is widely used for time series forecasting. Min-Max transformation has been used for
data preparation. Here, we have used one LSTM layer as a simple LSTM model and a Dense layer
is used as the output layer. Then, compile the model using the loss function, optimizer and metrics.
This package is based on Keras and TensorFlow modules.

Usage
ts.lstm(
ts,
xreg = NULL,
tsLag,
xregLag = 0,
LSTMUnits,
DropoutRate = 0,
Epochs = 10,
CompLoss = "mse",
CompMetrics = "mae",
ActivationFn = "tanh",
SplitRatio = 0.8,
ValidationSplit = 0.1
)

Arguments
ts Time series data
xreg Exogenous variables
tsLag Lag of time series data
xregLag Lag of exogenous variables
LSTMUnits Number of unit in LSTM layer
DropoutRate Dropout rate
Epochs Number of epochs
CompLoss Loss function
CompMetrics Metrics
ActivationFn Activation function
SplitRatio Training and testing data split ratio
ValidationSplit
Validation split ration
ts.lstm 3

Value
• TrainFittedValue: Fitted value of train data
• TestPredictedValue: Predicted value of test data
• AccuracyTable: RMSE and MAPE of train and test data

References
Paul, R.K. and Garai, S. (2021). Performance comparison of wavelets-based machine learning
technique for forecasting agricultural commodity prices, Soft Computing, 25(20), 12857-12873

Examples

y<-rnorm(100,mean=100,sd=50)
x1<-rnorm(100,mean=50,sd=50)
x2<-rnorm(100, mean=50, sd=25)
x<-cbind(x1,x2)
TSLSTM<-ts.lstm(ts=y,xreg = x,tsLag=2,xregLag = 0,LSTMUnits=5, Epochs=2)
Index

ts.lstm, 2

You might also like