8000 Fixing some issues when we have a vector-valued time-varying parameter in the state-space class + started working on multivariate time series in the structural class. by sangrey · Pull Request #490 · pymc-devs/pymc-extras · GitHub
[go: up one dir, main page]

Skip to content

Fixing some issues when we have a vector-valued time-varying parameter in the state-space class + started working on multivariate time series in the structural class. #490

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sangrey
Copy link
@sangrey sangrey commented May 30, 2025

This PR fixes two issues in the PytensorRepresentation class that affect how time-varying parameters are validated and reshaped.

Changes

1. Corrected a bug in shape validation:
The check for mismatched static shape of time-varying inputs (when X.ndim == 2) incorrectly compared X.shape[1:] instead of shape[1:].  X.shape is a symbolic tensor. 

2.  X has two dimensions if it is time-varying & vector valued or if is not-tie-varying and not vector valued.  I added a check to ensure that we were in case two before adding additional dimensions. 

I also brought in a bunch of changes to structural.py to get them to work with a multivariate time series.

1. Generalized __init__ methods to accept endog_names and set k_endog dynamically.

2. Added ObsIntercept component for flexible, time-varying observation intercepts.

3. Extended populate_component_properties and make_symbolic_graph methods to handle multivariate shapes.
  1. Parameter shapes, constraints, and dimensions now adapt to multivariate settings.

See the discussion on Discourse here: https://discourse.pymc.io/t/how-do-i-set-a-time-varying-observation-intercept-in-a-state-space-model/17000/8

@sangrey sangrey changed the title Removing some spurious checks with the observation intercept has a time-varying dimension. Fixing some issues when we have a vector-valued time-varying parameter in the state-space class. May 30, 2025
@sangrey sangrey changed the title Fixing some issues when we have a vector-valued time-varying parameter in the state-space class. Fixing some issues when we have a vector-valued time-varying parameter in the state-space class + started working on multivariate time series in the structural class. May 30, 2025
@sangrey sangrey marked this pull request as draft May 30, 2025 16:15
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.

1 participant
0