pm.NoDistribution model not working

So far the NoDistribution model in ver 4 still isn’t working for me. And this is the error message I’ve been getting, something about the ‘dist_param’ of the attribute, Distribution.dist().

I’ve read similar issues about some other distribution models also having the same issue. Would love some insights to this.

1 Like

Welcome!

Generally, pm.NoDistribution is only used to as a parent for new distribution classes. Using it directly in a model like this is atypical. Can you provide some context for what you are trying to do?

1 Like

Hey thanks for replying. We are using the pm.NoDistribution as a filler model for a variable that doesn’t have a prior, but rather depends on other parameters and is sampled by a Gibbs sampler for a Tikhonov regularization model.

In the previous pymc3 version, this model was working just fine, however, after we’ve upgraded to pymc4, this model function is no longer working.

Can you use a pm.Flat or pm.DensityDist (and manually assign it to your gibbs sampler) for that?

NoDistribution is now indeed a kind of metaclass that is not going to work on it’s own.

3 Likes

Using the pm.Flat distribution gives me the following error message: “module ‘pymc.model’ has no attribute ‘FreeRV’.” following by the failure of the sampler chains.

Can you share the whole code/ error message? You are probably trying to use some old API that has changed.



These are the definition of that variable requiring a flat distribution and the error message I got when running the samplers.

FreeRV is no longer a thing in V4. All PyMC variables are now simple Aesara TensorVariables. You’ll have to update your custom step sampler logic.