View source: R/trajectory-embedding.R
| trajectory_embedding | R Documentation |
Builds past and future cumulative-trajectory matrices for all columns in a
multivariate time-series data set. Rows containing unavailable lag or lead
values are removed from the aligned training matrices, while
latest_trajectory retains the latest past trajectory row for
forecasting.
trajectory_embedding(ts_set, trajectory_window)
ts_set |
A data frame or matrix of numeric time series in columns. |
trajectory_window |
Positive integer number of lag and lead horizons. |
A list with past_trajectories, future_trajectories,
latest_trajectory, and time_index. The time_index vector
indicates rows retained in the aligned past and future trajectory matrices.
prices <- data.frame(a = c(100, 101, 103, 104, 106), b = c(50, 52, 51, 53, 54))
trajectories <- trajectory_embedding(prices, trajectory_window = 2)
dim(trajectories$past_trajectories)
dim(trajectories$future_trajectories)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.