-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
When working in #5690, I realized we have a bug when doing the following:
import pymc as pm
x = pm.GaussianRandomWalk.dist(init=pm.Normal.dist(), steps=5, shape=(3, ...))
print(x.shape.eval()) # [3, 3, 6]; should be [3, 6]
print(x.eval()) # ValueErrorThis happens because we have to resize init to be of the same size of x, as the GaussianRandomWalk (GRW) is a composite distribution of init + innovations. We do this in dist, and I simply did not consider that shape could have an ellipsis.
In general, this sort of issue will be prevalent in most "composite" distributions, such as LKJCorr, Censored, Mixture, and so on, where we need to resize some of the the dist arguments to match size, shape, dims or else ask users to to it themselves. We can make things quite simpler for us if we don't allow the ellipsis or shape argument into the dist classmethod, as we will only have to worry about size in that case.
Metadata
Metadata
Assignees
Labels
No labels