Skip to content

Allow partial imputation with pm.observe #7204

Open
@ricardoV94

Description

@ricardoV94

One tricky thing will be to work in conjunction with #6932

Partial imputation is a model transformation that happens usually at model.register_rv and creates two model RVs (the observed and unobserved components) that are the joined together in a deterministic (with the original name) to look like a single entity in case the variable is used downstream elsewhere (or just so it shows in the trace)

We could read nan in constant values and do the same automatic imputation as observe does.

Besides this, and what I think is a better API, we could add a mask kwarg, that specifies which subset dimensions of the variable are to be observed, and then trigger the same kind of model transformation that observe=[x, np.nan]) does. This could be done without a warning because it's explicit.

The second approach as the benefit that the mask can be a shared variable (i.e., pm.Data) that can be updated later. See #6626

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions