Skip to content

Allow batch dimension on data in statespace models #406

@jessegrabowski

Description

@jessegrabowski
Member

The most requested feature for the statespace module is to handle multiple time series in a single MCMC run. This will require support for batch dimensions. I think the easiest way to attack this will be to refactor the KalmanFilter class to be an OpFromGraph. My original class-based design was inspired by the statsmodels implementation, but it doesn't take full advantage of pytensor.

Thinking more about this, I don't know if KF needs to be an OFG as a first step. It might still be nice to have a AbstractKalmanFilter dummy that we can rewrite to specialized cases, but when I wrote this issue I was a bit obsessed with OFG. The custom gradients are still on my mind, though. So the next two sentences remain true:

An additional advantage of this will be the ability to define a custom gradient. See #332.

Finally, it will let us handle special case filters via rewrites, rather than asking the user to pick a filter up front.

Activity

changed the title [-]Refactor `KalmanFilter` class as `OpFromGraph`[/-] [+]Allow batch dimension on data in statespace models[/+] on Jan 23, 2025
AlexAndorra

AlexAndorra commented on Aug 30, 2025

@AlexAndorra
Contributor

I think that one too can be closed @jessegrabowski

jessegrabowski

jessegrabowski commented on Aug 30, 2025

@jessegrabowski
MemberAuthor

I want to keep it open as a reference to #450. We still can't simply have a batch dim on data that vectorizes a model, and I still want that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @AlexAndorra@jessegrabowski

        Issue actions

          Allow batch dimension on data in statespace models · Issue #406 · pymc-devs/pymc-extras