TimeSeriesSRC.partoacf

TimeSeriesSRC.partoacf(phi, theta, lagmax, var_a)

Compute the theoretical autocovariance function of an ARMA process.

Uses the Yule-Walker method: solves a linear system for the first p lags, then extends the autocovariance sequence by the AR recursion.

The ARMA convention is:

\[y(t) + \phi_1 y(t-1) + \cdots + \phi_p y(t-p) = a(t) + \theta_1 a(t-1) + \cdots + \theta_q a(t-q)\]
Parameters:
  • phi (array-like) – AR polynomial including the leading 1: [1, phi1, phi2, ...].

  • theta (array-like) – MA polynomial including the leading 1: [1, theta1, theta2, ...].

  • lagmax (int) – Number of lags to compute; output covers lags 0 through lagmax - 1.

  • var_a (float) – Variance \(\sigma_a^2\) of the white-noise input a(t).

Returns:

  • acf (ndarray, shape (lagmax,)) – Theoretical autocovariance function. acf[0] is the variance of y.

  • imp (ndarray, shape (p,)) – First p coefficients of the impulse response of \(C(B) / D(B)\).

Examples

>>> from TimeSeriesSRC.basefunctions.partoacf import func_partoacf
>>> acf, imp = func_partoacf([1, 0.8], [1], 10, 1.0)
>>> round(acf[0], 3)   # variance = 1 / (1 - 0.64) ≈ 2.778
2.778

See also

func_partoacf_pmod

Wrapper that reads polynomials from a pmodel.

uniAnal

Computes the sample ACF from data.