PerturbationDSGEResult.state_space#

property PerturbationDSGEResult.state_space: _LinearGaussianStateSpace | _NonlinearStateSpace[source]#

The solution at the estimate on its substrate.

Linear-Gaussian at first order, the pruned nonlinear system at second; re-emitted through the engine so it is the same object the likelihood saw.

Example

>>> import numpy as np
>>> class Latent:
...     parameter_names, bounds = ("rho", "sigma"), ((0.0, 0.99), (0.01, 1.0))
...     n_states, n_controls = 1, 1
...     def equations(self, th, y_next, y, x_next, x):
...         return np.array([y[0] - x[0], x_next[0] - th[0] * x[0]])
...     def steady_state(self, th):
...         return np.zeros(1), np.zeros(1)
...     def shock_loading(self, th):
...         return np.array([[th[1]]])
...     def observation(self, th):
...         return np.array([[0.0, 1.0]]), np.zeros(1), np.array([[1e-4]])
...     def log_prior(self, th):
...         return 0.0
>>> rng = np.random.default_rng(0)
>>> x = rng.standard_normal(80)
>>> first = PerturbationDSGE(Latent(), x, order=1).fit([0.5, 0.5], filter="kalman")
>>> second = PerturbationDSGE(Latent(), x, order=2).fit([0.5, 0.5])
>>> type(first.state_space).__name__, type(second.state_space).__name__
('_LinearGaussianStateSpace', '_NonlinearStateSpace')