Hello! The error means that you don’t have a function that returns the likelihood of the data for a given sigma value. Looking at custom, it seems like custom generates a bunch of samples from some probability distribution. But instead of samples, we need a density or likelihood. One analogy that might be helpful - if we are working with the scipy.stats module, it has a normal distribution with two methods: this one generates samples.
stats.norm.rvs()
This one returns probabilities.
stats.norm.pdf()
It’s only the latter type of function that would work here.
So my recommendation is to figure out what density formula or likelihood formula goes with the custom distribution you are trying to build. If that doesn’t exist or is unknown, you might look into using simulator distribution in pymc which measures the distance between your data and the rvs samples.
Oh one other things - if you want to use metropolis-hastings, you’ll need to tell the pm.sample function that explicitly with step = pm.Metropolis