[][src]Function arima::util::lag

pub fn lag<T: Num + Copy>(x: &[T], tau: u32) -> Vec<T>

Returns a n-tau vector containing the time series lagged by tau.

Arguments

  • &x - Reference to input vector slice of length n.
  • tau - Lag.

Returns

  • Output vector of length n-tau.

Example

use arima::util;
let x = [-4, -9, 20, 23, -18, 6];
assert_eq!(util::lag(&x, 2), &[20, 23, -18, 6]);