mesmer.stats.auto_regression._draw_auto_regression_correlated_np#
- mesmer.stats.auto_regression._draw_auto_regression_correlated_np(*, intercept, coefs, covariance, n_samples, n_ts, seed, buffer)#
Draw time series of an auto regression process with possibly spatially-correlated innovations
Creates n_samples auto-correlated time series of order ar_order and length n_ts for each set of n_coefs coefficients (typically one set for each grid point), the resulting array has shape n_samples x n_ts x n_coefs. The innovations can be spatially correlated.
- Parameters:
intercept (float or ndarray of length n_coefs) – Intercept of the model.
coefs (ndarray of shape ar_order x n_coefs) – The coefficients of the autoregressive process. Must be a 2D array with the autoregressive coefficients along axis=0, while axis=1 contains all idependent coefficients.
covariance (float or ndarray of shape n_coefs x n_coefs) – The (co-)variance array. Must be symmetric and positive-semidefinite.
n_samples (int) – Number of samples to draw for each set of coefficients.
n_ts (int) – Number of time steps to draw.
seed (int) – Seed used to initialize the pseudo-random number generator.
buffer (int) – Buffer to initialize the autoregressive process (ensures that start at 0 does not influence overall result).
- Returns:
out (ndarray) – Drawn realizations of the specified autoregressive process. The array has shape n_samples x n_ts x n_coefs.
Notes
The ‘innovations’ is the error or noise term.
As this is not a deterministic function it is not called predict. “Predicting” an autoregressive process does not include the innovations and therefore asymptotes towards a certain value (in contrast to this function).