Package 'LTAR'

Title: Tensor Forecasting Functions
Description: A set of tools for forecasting the next step in a multidimensional setting using tensors. In the examples, a forecast is made of sea surface temperatures of a geographic grid (i.e. lat/long). Each observation is a matrix, the entries in the matrix and the sea surface temperature at a particular lattitude/longitude. Cates, J., Hoover, R. C., Caudle, K., Kopp, R., & Ozdemir, C. (2021) "Transform-Based Tensor Auto Regression for Multilinear Time Series Forecasting" in 2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA) (pp. 461-466), IEEE <doi:10.1109/ICMLA52953.2021.00078>.
Authors: Kyle Caudle [aut, cre], Randy Hoover [ctb], Jackson Cates [ctb]
Maintainer: Kyle Caudle <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-10-16 04:00:57 UTC
Source: https://github.com/cran/LTAR

Help Index


Forecast error calculations

Description

Determines the Frobenius norm between true tensor and the actual tensor.

Usage

err(true_tensor, forecast_tensor)

Arguments

true_tensor

: The true tensor from the test set.

forecast_tensor

: The predicted values from LTARpred()

Value

Error: The Frobenius norm between the actual and predictor tensor slices at each forecast step.

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

Examples

require(rTensor)
data(tensor)
tnsr <- as.tensor(tensor)
tensorTest <- tnsr[,1:2,]
tensorTrain <- tnsr[,3:2000,]
forecast <- LTARpred(p=5,tensorTrain,h=2)
predTensor <- forecast$ypred
errors <- err(tensorTest,predTensor)
errors

Tensor Autoregression (TAR) Model

Description

Fits a Tensor Autoregression (TAR) Model to historical 3D tensor data and returns the coefficient tensor (A) and the constant matrix (C).

A=[A1A2Ap],C\mathbf{A}=[A_1 | A_2 | \ldots | A_p], \mathbf{C}

Usage

LTAR(p,tnsr,type = c("const", "trend", "both", "none"),season=NULL)

Arguments

p

: Number of lags

tnsr

: A 3D tensor

type

:Type of deterministic regressors to include.

season

: Inclusion of centered seasonal dummy variables (integer value of frequency).

Value

The coefficient tensor

A=[A1A2Ap]\mathbf{A}=[A_1 | A_2 | \ldots | A_p]

and the constant matrix

CC

for the LTAR model:

yt=A1yt1++Apyp+CDt+ut.\mathbf{y}_t = A_1\mathbf{y}_{t-1}+\ldots+A_p\mathbf{y}_p+CD_t+\mathbf{u}_t.

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

References

Cates, J., Hoover, R. C., Caudle, K., Kopp, R., & Ozdemir, C. (2021, December). Transform-Based Tensor Auto Regression for Multilinear Time Series Forecasting. In 2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA) (pp. 461-466). IEEE.

Examples

require(rTensor)
data(tensor)
tnsr <- as.tensor(tensor)
# an LTAR(1) model with trend
model <- LTAR(p=1,tnsr,type="trend")

Forecast for a 3D Tensor Autoregression Model

Description

Using a historical 3D tensor, the LTARpred function will forecast h steps into the future.

Usage

LTARpred(p, tnsr, h, type = c("const", "trend", "both", "none"), season = NULL)

Arguments

p

: Number of time series lags

tnsr

: A 3D tensor

h

: Number of steps to forecast

type

Type of deterministic regressors to include.

season

: Inclusion of centered seasonal dummy variables (integer value of frequency).

Value

A Tensor-class object which contains the h step forecasts.

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

References

Cates, J., Hoover, R. C., Caudle, K., Kopp, R., & Ozdemir, C. (2021, December). Transform-Based Tensor Auto Regression for Multilinear Time Series Forecasting. In 2021 20th IEEE International Conference on Machine Learning and Applications (ICMLA) (pp. 461-466). IEEE.

Examples

require(rTensor)
data(tensor)
tnsr <- as.tensor(tensor)
result <- LTARpred(p=5,tnsr,h=2,type="trend",season=12)

Tensor Transformation

Description

Performs a tensor transformation of a 3D tensor using the discrete cosine transform along mode 3.

Usage

Ltrans(tnsr)

Arguments

tnsr

: A 3D tensor

Value

a Tensor-class object that has been transformed using the DCT.

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

Examples

require(rTensor)
data(tensor)
tnsr <- as.tensor(tensor)
trans_tensor <- Ltrans(tnsr)
# print first lateral slice
trans_tensor[,1,]

Sea Surface Temperatures

Description

A 5-by-6 grid of sea-surface temperatures from 5 degrees N, 180 degrees W to 5 degrees S, 110 degrees W recorded hourly from 7:00PM on 4/26/94 to 3:00AM on 7/19/94, yielding 2000 epochs.

Usage

data("tensor")

Format

The format is: num [1:5, 1:2000, 1:6] 28.1 28.4 28.1 28.6 29.3 ...

References

Mark Rogers, Lei Li, and Stuart J Russell, "Multilinear dynamical systems for tensor time series," in Advances in Neural Information Processing Systems (NIPS), 2013, pp. 2634–2642.

Examples

data(tensor)