| ts_data | R Documentation |
Construct a time series data object used throughout the DAL Toolbox.
Accepts either a vector (raw time series) or a matrix/data.frame already
organized in sliding windows. Internally, a ts_data is stored as a matrix
with sw lag columns named t{lag} (e.g., t9, t8, ..., t0). When sw is
zero or one, the series is stored as a single column (t0).
ts_data(y, sw = 1)
y |
Numeric vector or matrix-like. Time series values or sliding windows. |
sw |
Integer. Sliding-window size (number of lag columns). |
A ts_data object (matrix with attributes and column names).
# Example: building sliding windows
data(tsd)
head(tsd)
# 1) Single-column ts_data (no windows)
data <- ts_data(tsd$y)
ts_head(data)
# 2) 10-lag sliding windows (t9 ... t0)
data10 <- ts_data(tsd$y, 10)
ts_head(data10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.