nutpie
nutpie copied to clipboard
store_unconstrained doesn't appear to do anything
My understanding is that if you set it false, all the _log__ suffixed parameters shouldn't be returned in the trace. However, they linger:
import pymc as pm
import nutpie
with pm.Model() as model:
a = pm.Exponential('a',scale=1)
compiled_model = nutpie.compile_pymc_model(model)
trace = nutpie.sample(compiled_model=compiled_model,store_unconstrained=False)
assert not hasattr(trace.posterior, 'a_log__')
Versions:
nutpie 0.14.3 py311h533ab2d_0 conda-forge
pymc 5.22.0 hd8ed1ab_0 conda-forge
store_unconstrained controls if the unconstrained point is stored in trace.sampler_stats as a 1d vector. There is currently no way to control the unconstrainted values in trace.posterior. But maybe it should do that too? In that case it would do two different things though...
store_unconstrainedcontrols if the unconstrained point is stored intrace.sampler_statsas a 1d vector. There is currently no way to control the unconstrainted values intrace.posterior. But maybe it should do that too? In that case it would do two different things though...
Ahh that makes sense. Let's not make it do two different things. The cleaner fix is to just allow passing var_names like issue #100
I also expected this behavior, and complained about it in #176 . Glad I'm not the only one :)
IMO the correct behavior is that nutpie should an unconstrained_posterior group in the returned InferenceData. This is suggeted by the arviz devs here. See #78