TimeSeriesSRC.multiAnal¶
- TimeSeriesSRC.multiAnal(u, y, nng=5, ndg=5, nnh=5, ndh=5, lg=12, lh=12)¶
Multivariate analysis: impulse response, residual ACF, and GPAC tables.
Pre-whitens the input
uwith a BIC-selected ARMA model, estimates the impulse response betweenuandyvia the Wiener-Hopf equations, and computes GPAC tables for both the G (transfer function) and H (noise) components. Produces plots of the impulse response, residual ACF, and the two GPAC arrays.- Parameters:
u (array-like) – 1-D input (exogenous) sequence.
y (array-like) – 1-D output sequence (same length as
u).nng (int, optional) – Maximum numerator order for the G GPAC table. Default 5.
ndg (int, optional) – Maximum denominator order for the G GPAC table. Default 5.
nnh (int, optional) – Maximum numerator order for the H GPAC table. Default 5.
ndh (int, optional) – Maximum denominator order for the H GPAC table. Default 5.
lg (int, optional) – Number of impulse-response lags to compute. Default 12.
lh (int, optional) – Accepted for API compatibility; not used in the current implementation. The residual-ACF lag count is determined by
nnh + ndh + 1. Default 12.
- Returns:
g (ndarray, shape (lg+1,)) – Estimated impulse response from
utoy.rv (ndarray, shape (1, 2*(nnh+ndh+1)+1)) – Residual autocorrelation function.
g_gpac (ndarray, shape (nng, ndg)) – GPAC table for the G transfer function.
h_gpac (ndarray, shape (nnh, ndh)) – GPAC table for the H noise model.
Examples
>>> import numpy as np >>> from scipy.signal import lfilter >>> from TimeSeriesSRC.basefunctions.multiAnal import func_multiAnal >>> rng = np.random.default_rng(0) >>> u = rng.standard_normal(300) >>> e = rng.standard_normal(300) * 0.2 >>> y = lfilter([1], [1, 0.5], u) + lfilter([1], [1, -0.8], e) >>> g, rv, g_gpac, h_gpac = func_multiAnal(u, y, lg=10)