[−][src]Function arima::acf::var_phi_rho_cov
pub fn var_phi_rho_cov<T: Float + From<u32> + From<f64> + Copy + Add + AddAssign + Div>(
phi: &[T],
rho: &[T],
cov0: T
) -> Result<T, ArimaError>
Estimate the variance of a time series of length n, given the AR parameters, auto-correlation coefficients (ACF), and the auto-covariance for lag zero.
Arguments
&x
- Reference to input vector slice of length n.order
- Order of the AR model. Defaults to n-1.
Returns
- Estimated variance.
Example
use arima::acf; let x = [1.0, 1.2, 1.4, 1.6]; let rho = acf::acf(&x, Some(3), false).unwrap(); let cov0 = acf::acf(&x, Some(0), true).unwrap()[0].clone(); let (phi, _var) = acf::ar_dl_rho_cov(&rho, cov0, Some(2)).unwrap(); acf::var_phi_rho_cov(&phi, &rho, cov0);