Skip to content

Handle broadcasting of parameters in Censored distributions #5703

Closed
@ricardoV94

Description

@ricardoV94

When size is not specified, the base distribution is not resized and can broadcast with lower / upper, with repeated draws.

import aesara.tensor as at
import pymc as pm
rng = at.random.default_rng(123)
x = pm.Censored.dist(pm.Normal.dist(0), lower=[-1, -1, -1], upper=[1, 1, 1], rngs=(rng,))
x.eval()  # array([-0.98912135, -0.98912135, -0.98912135])

We need to do something like in:

# If not explicit, size is determined by the shapes of mu, sigma, and init
bcast_shape = at.broadcast_arrays(mu, sigma, init)[0].shape
init = resize_dist(init, bcast_shape)

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