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_states
listofstr Names of observed series, in data-column order. Each entry is either a model variable’s
base_nameor a key inobservation_equations.- measurement_error
listofstr, optional Observed states that have measurement error.
- constant_params
listofstror “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_aggregation
dictofstrtostr, optional Observed states that require temporal aggregation or explicit low-frequency timing.
"sum": Flow variables like GDP (observed = sum ofaggregation_periodvalues). 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
NaNin data) or low-frequency point-in-time observations. The Kalman filter handles missing values automatically.- aggregation_period
int 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_intercept
listofstr, 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 anobs_interceptof zero — appropriate when the data is already in deviation form (HP-cycled, demeaned, etc.). Passobserved_statesto enable per-draw steady-state subtraction for every observed series. DefaultNone(no entries;obs_interceptleft at zero).- observation_equations
dictmappingstrtostr, 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 inss_obs_intercept.- solver
str Perturbation solver to use.
- mode
str, optional PyTensor compilation mode.
- verbosebool
Print diagnostic messages.
- max_iter
int Maximum iterations for iterative solvers.
- tol
float 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.
- observed_states