PerturbationModelSpecification#

class cultivars.multivariate.structural.perturbation.PerturbationModelSpecification(*args, **kwargs)[source]#

What a perturbation model must supply to be solved and estimated.

Every method takes the structural parameter vector theta in its natural (constrained) space. The engine differentiates equations numerically, so it must be smooth in its arguments near the steady state and must be written in the variables the approximation should be taken in – write it in logs for a log-linear approximation.

Variables:
  • parameter_names (Sequence[str]) – One label per structural parameter.

  • bounds (Sequence[tuple[float, float]]) – (d, 2) lower and upper bounds per parameter; -inf / inf for an unbounded side.

  • n_states (int) – Predetermined variables, exogenous processes included.

  • n_controls (int) – Non-predetermined variables.

Note

The protocol is not runtime_checkable, and nothing here checks an implementation against it. A method with the wrong signature or a return of the wrong shape surfaces where the engine first uses it.

See also

Attributes#

parameter_names

One label per structural parameter, in the order of theta.

bounds

(lower, upper) per parameter; -inf or inf for an unbounded side.

n_states

Number of predetermined variables n_x, exogenous processes included.

n_controls

Number of non-predetermined variables n_y.

Methods#

equations(theta, y_next, y, x_next, x)

Residuals of E_t f(y', y, x', x) = 0, n_states + n_controls of them.

log_prior(theta)

Log prior density in the constrained space; -inf outside support.

observation(theta)

(design, intercept, obs_cov): observables = design @ [x; y] + intercept + e.

shock_loading(theta)

(n_states, n_shocks) loading of standard-normal shocks on the states.

steady_state(theta)

(x_ss, y_ss) solving the equations with expectations removed.