Skip to content

Add k_endog argument to structrual Components to enable multivariate structural models #485

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

Open
jessegrabowski opened this issue May 28, 2025 · 0 comments
Labels
enhancements New feature or request help wanted Extra attention is needed major statespace

Comments

@jessegrabowski
Copy link
Member

Currently, we can only do univariate timeseries analysis with the structural framework. There's no reason for this -- the same framework can be extended to multiple time series. We would just need some extra API to support it. Basically:

  • All components would need a k_endog and endog_names arguments, which would determine how many variables we're modeling
  • When we call build, we need to gather up the set union of all endog_names. They don't have to all match, because we could have some components in one but not another
  • We need some new logic to build the Z matrix to map the right hidden states to the right observations.

The biggest challenge would be if we want to allow latent state sharing. For example, I could imagine a model where we want several time series to share the same LevelTrend component. In this case, we might need an additional argument, like shared_endog_names or something? Then instead of copying + block-concatenating the relevant matrices, we map all the different observed timeseries to the same hidden states via the Z matrix.

Obviously this is all just off the top of my head, suggestions/criticisms highly welcome.

@jessegrabowski jessegrabowski added enhancements New feature or request help wanted Extra attention is needed major statespace labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements New feature or request help wanted Extra attention is needed major statespace
Projects
None yet
Development

No branches or pull requests

1 participant