[−][src]Function arima::acf::var
pub fn var<T: Float + From<u32> + From<f64> + Into<f64> + Copy + Add + AddAssign + Div>(
x: &[T],
order: Option<usize>
) -> Result<T, ArimaError>
Estimate the variance of a time series of length n via Durbin-Levinson.
If you already calculated the AR parameters, auto-correlation coefficients (ACF), and
the auto-covariance for lag zero, consider using var_phi_rho_cov
instead. Please note that
this might yield a different result.
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]; acf::var(&x, Some(2));