[][src]Function arima::acf::pacf_rho_cov0

pub fn pacf_rho_cov0<T: Float + From<u32> + From<f64> + Into<f64> + Copy + AddAssign>(
    rho: &[T],
    cov0: T,
    max_lag: Option<usize>
) -> Result<Vec<T>, ArimaError>

Calculate the partial auto-correlation coefficients of a time series of length n, given the auto-correlation coefficients rho.

Arguments

  • &rho - Reference to auto-correlation coefficients rho.
  • max_lag - Maximum lag to calculate the PACF for. Defaults to n.

Returns

  • Output vector of length max_lag.

Example

use arima::acf;
let x = [1.0, 1.2, 1.4, 1.6];
let rho = acf::acf(&x, None, false).unwrap();
let cov0 = acf::acf(&x, Some(0), true).unwrap()[0];
let pr = acf::pacf_rho_cov0(&rho, cov0, Some(2)).unwrap();
assert!((pr[0] - 0.25).abs() < 1.0e-7);
assert!((pr[1] - -0.3866667).abs() < 1.0e-7);