h <- 2 # horizons
m <- 4 # temporal aggregation order
kt <- tetools(m)$dim["kt"]
# Build a horizon-stacked matrix: h rows, n * k_t columns
input_te <- seq_len(h * kt)
hmat <- as_hstack_telayout(input_te, agg_order = m)
tevec <- as_tevector(hmat, agg_order = m)
# all.equal(tevec, input_te, check.attributes = FALSE)
Run the code above in your browser using DataLab