gEconpy.model.model.autocovariance_matrix#

gEconpy.model.model.autocovariance_matrix(model, T=None, R=None, shock_std_dict=None, shock_cov_matrix=None, shock_std=None, n_lags=10, correlation=False, return_xr=True, **solve_model_kwargs)#

Compute the model’s autocovariance matrix using the stationary covariance matrix.

Alternatively, the autocorrelation matrix can be returned by specifying correlation = True.

In order to construct the shock covariance matrix, exactly one of shock_dict, shock_cov_matrix, or shock_std should be provided.

Parameters:
model: Model

DSGE Model associated with T and R

T: np.ndarray, optional

Transition matrix of the solved system. If None, this will be computed using the model’s solve_model method.

R: np.ndarray

Selection matrix of the solved system. If None, this will be computed using the model’s solve_model method.

shock_std_dict: dict, optional

A dictionary of shock sizes to be used to compute the stationary covariance matrix.

shock_cov_matrix: array, optional

An (n_shocks, n_shocks) covariance matrix describing the exogenous shocks

shock_std: float, optional

Standard deviation of all model shocks.

n_lags: int

Number of lags of auto-covariance and cross-covariance to compute. Default is 10.

correlation: bool

If True, return the autocorrelation matrices instead of the autocovariance matrices.

return_xr: bool

If True, return the covariance matrices as a DataArray with dimensions [“variable”, “variable_aux”, and “lag”]. Otherwise returns a 3d numpy array with shape (lag, variable, variable).

**solve_model_kwargs

Arguments forwarded to the solve_model method. Ignored if T and R are provided.

Returns:
acorr_mat: DataFrame