-
Notifications
You must be signed in to change notification settings - Fork 69
Allow exogenous regressors in BayesianVARMAX
#567
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for exogenous regressors to the BayesianVARMAX
model via observation intercepts. The implementation allows for flexible configuration where exogenous variables can be shared across all endogenous states or specified individually for each state.
Key changes include:
- Added
exog_state_names
andk_exog
parameters to support different exogenous variable configurations - Implemented data handling and parameter creation for exogenous regression coefficients
- Added comprehensive validation logic for parameter combinations
- Extended test coverage for all exogenous variable configuration scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
pymc_extras/statespace/models/VARMAX.py | Core implementation adding exogenous regressor support with parameter validation, data handling, and symbolic graph construction |
tests/statespace/models/test_VARMAX.py | Comprehensive test suite covering all exogenous variable configuration cases and error conditions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite the monster review! Thanks @jessegrabowski 🤩
* First pass on exogenous variables in VARMA * Adjust state names for API consistency * Allow exogenous variables in BayesianVARMAX * Eagerly simplify model where possible * Typo fix
This PR adds support for exogenous variables in
BayesianVARMAX
via the observation intercept. Same deal as SARIMAX -- it's implemented in a way that minimizes the number of states in the system.Unlike Statsmodels, we have support for each observed state to have its own regressors by passing a dictionary. If you just pass a list, everyone shares the same data.
Example 1: Everyone shares data, data names are auto-assigned
Example 2: Everyone shares data, data names are provided
Example 3: Each observes state (endogenous state) has its own exogenous regressors. y3 has no exogenous regressors at all, so it is omitted from the dictionary. It just so happens that each observed has its own regressors, but they could also share all or a subset.