Pm.step_methods() doesn't include pm.SMC() in pymc3 v 3.8

Hi all,

when I list the available sampling algorithms SMC is missing:

I am sure this is a beginners error but I am just starting to settle in to pymc3.
I am on Ubuntu 18.04, Python 3.7, installed via pip+git, pymc 3.8.


Hi Ondrej!
I think we’ll need more details here: what are you trying to do exactly?

Hey, yes, I am trying to get a marginal likelihood estimate for a model and in the documentation (section Sequential Monte Carlo in mentions that this can be used using sequential sampling. Does that clarify things? If there is another way to get the evidence I’d also be keen to hear about that. Thanks!

1 Like

Sorry about the confusion. The documentation is behind the last changes. Check this for a working example.

Notice that smc is no longer a step method and that the evidence is computed on the log-scale.


Thanks! And yes, log scale, noted.

I was having the same issue. I tried the updated example given by @aloctavodia and works fine. However, I realized that it seems that model does not have the attribute “marginal_log_likelihood” anymore. So, line In [8] in the example gives an error. I changed that line for something like:

BF_smc = np.exp(np.log(aux.marginal_likelihood) - np.log(models[0].marginal_likelihood))

It does work now, but I’m not sure it’s the optimal way of doing it.

Hi @pymilo The version on master has the attribute marginal_log_likelihood previous to that the attribute’s name was marginal_likelihood, and you computed a BF as a ratio of marginal likelihoods.