[][src]Function rstats::autocorr

pub fn autocorr(v1: &[i64]) -> Result<f64>

(Auto)correlation coefficient of pairs of successive values of (time series) integer variable.

Example

use rstats::autocorr;
const VEC1:[i64;14] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14];
assert_eq!(autocorr(&VEC1).unwrap(),0.9984603532054123_f64);