Skip to content

Timing in State Space models #416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
niskrev opened this issue Jan 24, 2025 · 2 comments · Fixed by #417
Closed

Timing in State Space models #416

niskrev opened this issue Jan 24, 2025 · 2 comments · Fixed by #417

Comments

@niskrev
Copy link
Contributor

niskrev commented Jan 24, 2025

I noticed a timing inconsistency in the Making a Custom Statespace Model.ipynb notebook.

Image

To be consistent with the general form in (1)-(2), the ar(3) model should be:

$$x(t) = \rho_1 x_{t-1} + \rho_2 x_{t-2} + \rho_3 x_{t-3} + \varepsilon_{t-1}$$

instead of

$$x(t) = \rho_1 x_{t-1} + \rho_2 x_{t-2} + \rho_3 x_{t-3} + \varepsilon_{t}$$

Alternatively, in (1) instead of $\varepsilon_{t}$ it should be $\varepsilon_{t+1}$. I realize that this doesn't matter in many cases, but in some models there is a big difference between the new state being driven by the same period innovation or the one from the last period. I apologise if this is explained elsewhere in the documentation, I have only looked at this notebook.

@jessegrabowski
Copy link
Member

You're absolutely right; this is a typo in the notebook. If you want to open a PR to fix it I'd appreciate it. Equation (1) ought to have $x_t$ on the left-hand side and $x_{t-1}$ on the right.

@niskrev
Copy link
Contributor Author

niskrev commented Jan 24, 2025

Thank you @jessegrabowski. I created a pull request with these changes.

Also, I want to thank you for the great work you are doing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants