Work in #5622 revealed this issue that we seem to have had for a long time:
import pymc as pm
with pm.Model() as m:
x = pm.Normal("x")
y = pm.Bernoulli("y", p=0.5)
trace = pm.sample() # <- will not use `init_nuts` to initialize NUTS
This is actually enforced in here:
|
if set(vars) != set(model.value_vars): |
|
raise ValueError("Must use init_nuts on all variables of a model.") |
It seems that we should find a solution to initialize nuts robustly when it only applies to a subset of variables, unless there are good reasons not to.
Work in #5622 revealed this issue that we seem to have had for a long time:
This is actually enforced in here:
pymc/pymc/sampling.py
Lines 2278 to 2279 in 80b5e86
It seems that we should find a solution to initialize nuts robustly when it only applies to a subset of variables, unless there are good reasons not to.