Skip to content

Conversation

@Dekermanjian
Copy link
Contributor

@Dekermanjian Dekermanjian commented Oct 19, 2025

This PR is related to #589 and aims to remove redundant parameters k_endog and k_exog from SSM models. The following models will be updated:

  • ETS Model
  • SARIMAX Model
  • VARMAX Model
  • DFM Model
  • Structural SSM API

In addition, this PR will also address

Closes #587
Closes #589

@Dekermanjian
Copy link
Contributor Author

Dekermanjian commented Oct 25, 2025

Hey @jessegrabowski, after updating all the models and the regression component in the structural api the complexity of the validation code dropped quite a bit. I am looking at pulling out that VARMAX validation utility to use across all the other models (SARIMAX, ETS, DFM) but the only commonality between them is how the endog_names are handled. I can pull out the validation for endog_names and wrap that up in a utility but that is only 4 lines of code. Do you think it is worth it? Never mind, I am going to do it. Once we have more models it will be worth it.

@jessegrabowski
Copy link
Member

I was going to say yes anyway :D

@jessegrabowski
Copy link
Member

jessegrabowski commented Oct 27, 2025

I am looking at pulling out that VARMAX validation utility to use across all the other models

Mark that this PR will close both #589 and #587 as a result

@Dekermanjian
Copy link
Contributor Author

Jesse, I marked the two open issues for closer upon merging this PR.

Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work as always! Left some feedback.

Also rebase, we just merged the Pytensor update that will fix tests.

return exog_dims


def _validate_endog_names(endog_names) -> int:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to validate_names, and add a optional: bool =True argument so it can either error or return None. Then you can eliminate _get_state_names in the regression component and use this instead. Also can use it for the exog names in SARIMAX, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a var_name argument as well so that if it does raise a value error the message will clearly state what variable is missing.

@Dekermanjian Dekermanjian force-pushed the remove_kendog_kexog_ssm branch from 9a3e24d to 330dc19 Compare October 29, 2025 23:12
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 this pull request may close these issues.

Remove k_endog argument from statespace model constructors VARMAX input validation functionality should be moved out to a helper

2 participants