gEconpy.model.model.simulate#

gEconpy.model.model.simulate(model, T=None, R=None, n_simulations=1, simulation_length=40, shock_std_dict=None, shock_cov_matrix=None, shock_std=None, random_seed=None, **solve_model_kwargs)#

Simulate the model over a certain number of time periods.

Parameters:
model: Model

DSGE Model object

T: np.ndarray, optional

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

R: np.ndarray, optional

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

use_param_priors: bool, optional

If True, each simulation will be generated using a different random draw from the model’s prior distributions. Default is False, in which case a fixed T and R matrix will be used for each simulation. If True, T and R are ignored.

n_simulationsint, optional

Number of trajectories to simulate. Default is 1.

simulation_lengthint, optional

Length of each simulated trajectory. Default is 40.

shock_std_dict: dict, optional

Dictionary of shock names and standard deviations to be used to build Q

shock_cov_matrix: array, optional

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

shock_std: float or sequence, optional

Standard deviation of all model shocks.

random_seedint, RandomState or Generator, optional

Seed for the random number generator.

**solve_model_kwargs

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

Returns:
xr.DataArray

Simulated trajectories.