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 |
Determines the Frobenius norm between true tensor and the actual tensor.
err(true_tensor, forecast_tensor)
err(true_tensor, forecast_tensor)
true_tensor |
: The true tensor from the test set. |
forecast_tensor |
: The predicted values from LTARpred() |
Error: The Frobenius norm between the actual and predictor tensor slices at each forecast step.
Kyle Caudle
Randy Hoover
Jackson Cates
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
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
Fits a Tensor Autoregression (TAR) Model to historical 3D tensor data and returns the coefficient tensor (A) and the constant matrix (C).
LTAR(p,tnsr,type = c("const", "trend", "both", "none"),season=NULL)
LTAR(p,tnsr,type = c("const", "trend", "both", "none"),season=NULL)
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). |
The coefficient tensor
and the constant matrix
for the LTAR model:
Kyle Caudle
Randy Hoover
Jackson Cates
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.
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) # an LTAR(1) model with trend model <- LTAR(p=1,tnsr,type="trend")
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) # an LTAR(1) model with trend model <- LTAR(p=1,tnsr,type="trend")
Using a historical 3D tensor, the LTARpred function will forecast h steps into the future.
LTARpred(p, tnsr, h, type = c("const", "trend", "both", "none"), season = NULL)
LTARpred(p, tnsr, h, type = c("const", "trend", "both", "none"), season = NULL)
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). |
A Tensor-class object which contains the h step forecasts.
Kyle Caudle
Randy Hoover
Jackson Cates
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.
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) result <- LTARpred(p=5,tnsr,h=2,type="trend",season=12)
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) result <- LTARpred(p=5,tnsr,h=2,type="trend",season=12)
Performs a tensor transformation of a 3D tensor using the discrete cosine transform along mode 3.
Ltrans(tnsr)
Ltrans(tnsr)
tnsr |
: A 3D tensor |
a Tensor-class object that has been transformed using the DCT.
Kyle Caudle
Randy Hoover
Jackson Cates
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) trans_tensor <- Ltrans(tnsr) # print first lateral slice trans_tensor[,1,]
require(rTensor) data(tensor) tnsr <- as.tensor(tensor) trans_tensor <- Ltrans(tnsr) # print first lateral slice trans_tensor[,1,]
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.
data("tensor")
data("tensor")
The format is: num [1:5, 1:2000, 1:6] 28.1 28.4 28.1 28.6 29.3 ...
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.
data(tensor)
data(tensor)