I’m essentially building a wrapper around pymc for building more complex models (somewhat similar to bambi), and am trying to use pathfinder for sampling.
Sampling itself seems to work in most cases, but I run into two issues:
a) pmx.fit does not put ‘observed_data’ into the idata, and my pipeline relies on that being present
b) pmx.fit does not take initvals as an argument so all models that need manual initvals (like those making use of ordered transform) fail.
So I’m wondering if I can work around these two issues.
For instance, can I add the observed_data manually if I have access to the model object?
Also - is there a way to just inject initvals into the model after the fact (akin to do or observe commands)?
And it seems initvals can be relatively easily loaded into the model with:
for rv_name, ivals in initvals:
fmodel.set_initval(model.named_vars[rv_name],ivals)
Next question I have:
Any objections to adding those things to pymc_extras.fit so it would behave more compatibly to pm.sample? Because if not, I’d happily do a PR with that