pub fn lag<T: Num + Copy>(x: &[T], tau: u32) -> Vec<T>
Returns a n-tau vector containing the time series lagged by tau.
&x
- Reference to input vector slice of length n.
tau
- Lag.
- Output vector of length n-tau.
use arima::util;
let x = [-4, -9, 20, 23, -18, 6];
assert_eq!(util::lag(&x, 2), &[20, 23, -18, 6]);