Empirical Prior Distribution


im having some trouble figuring out how to define an empirical prior distribution.
i have a histogram that represents my prior distribution and i want to define a prior from it.
is there any simple way to do this?

Thank you!

Depending on the shape and the support of the empirical distribution. Usually, approximating it with a Gaussian or a mixture of Gaussian would be a way to go.

1 Like

Thanks for the answer!
I’ll ask something a bit different, if I want to model a prior as a step function with different densities In different regions.
For example, 0.2 between 0 and 1, 0.5 between 1 and 1.5 and so forth.

What’s the best way?

Thank you!

You might have some problem sampling as the function is not differentiable at the boundary, but in general, you can write your prior as DensityDist with tt.switch, or using pm.Potential.