gEconpy.model.statespace.DSGEStateSpace.configure#

DSGEStateSpace.configure(observed_states, measurement_error=None, constant_params=None, full_shock_covaraince=False, temporal_aggregation=None, aggregation_period=4, ss_obs_intercept=None, observation_equations=None, solver='gensys', mode=None, verbose=True, max_iter=50, tol=1e-06, use_adjoint_gradients=True, use_direct_lyapunov=False)#

Configure the statespace model for estimation.

Parameters:
observed_stateslist of str

Names of observed series, in data-column order. Each entry is either a model variable’s base_name or a key in observation_equations.

measurement_errorlist of str, optional

Observed states that have measurement error.

constant_paramslist of str or “auto”, optional

Parameters held constant (not estimated). "auto" freezes all parameters without priors.

full_shock_covaraincebool

If True, estimate a full shock covariance matrix instead of diagonal.

temporal_aggregationdict of str to str, optional

Observed states that require temporal aggregation or explicit low-frequency timing.

  • "sum": Flow variables like GDP (observed = sum of aggregation_period values). Requires cumulator state augmentation.

  • "mean": Rates or prices reported as period averages. Requires cumulator augmentation.

  • "last": Point-in-time at end of aggregation window. No cumulator needed. Equivalent to omitting the variable, but explicit about timing.

  • "first": Point-in-time at start of aggregation window. No cumulator needed. Data should have values at the first period of each window.

Variables NOT in this dict use a direct selector — suitable for high-frequency observations (no NaN in data) or low-frequency point-in-time observations. The Kalman filter handles missing values automatically.

aggregation_periodint

Number of model periods per low-frequency observation. For example, 4 when fitting a quarterly model with annual data, or 3 for a monthly model with quarterly data. Default is 4.

ss_obs_interceptlist of str, optional

Observed states for which to populate ssm["obs_intercept"] with a parameter-dependent steady-state value, re-evaluated on every parameter draw. For each entry, the intercept is \(\\log v_{ss}(p)\) if the variable was log-linearized when building the model and \(v_{ss}(p)\) if it was level-linearized. Observed states not in this list keep an obs_intercept of zero — appropriate when the data is already in deviation form (HP-cycled, demeaned, etc.). Pass observed_states to enable per-draw steady-state subtraction for every observed series. Default None (no entries; obs_intercept left at zero).

observation_equationsdict mapping str to str, optional

Override map keyed by observed-series name (must be a subset of observed_states). Values are GCN-syntax expressions in model variables and parameters, e.g. "log(Y[]) - log(Y[-1]) + log(Z[])". Contemporaneous and lagged references are accepted; leads are not. A name in this dict cannot also appear in ss_obs_intercept.

solverstr

Perturbation solver to use.

modestr, optional

PyTensor compilation mode.

verbosebool

Print diagnostic messages.

max_iterint

Maximum iterations for iterative solvers.

tolfloat

Convergence tolerance for the solver.

use_adjoint_gradientsbool

Use adjoint gradients in scan_cycle_reduction.

use_direct_lyapunovbool

Use direct (rather than bilinear) Lyapunov solver.