bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.08k stars 124 forks source link

Make `var_names` accessible in `model.fit()` #828

Open digicosmos86 opened 3 months ago

digicosmos86 commented 3 months ago

In PyMC, pm.Sample() has a var_names parameter which allows the users to specify the variable names to be included in InferenceData. In Bambi, it seems that _run_mcmc() will override this argument when calling pm.sample(), leaving the users with no option to specify the variables that they want to include in the InferenceData. Maybe var_names can be added to model.fit() to make it possible to pass the user's own var_names?

tomicapretto commented 1 month ago

Do you have a particular use case in mind? In principle, I'm not against it. But I do see it causing things to fail if users pass var_names without knowing well what they're doing. Is your goal to exclude variables that are being included right now or to include variables that are excluded?

digicosmos86 commented 1 month ago

I think we want to be able to exclude certain parameters (especially deterministics) from InferenceData

tomicapretto commented 1 month ago

Are those deterministics computing parameters of the likelihood? Like mu or sigma in y ~ Normal(mu, sigma)? If that is the case, they are computed after the sampler finishes so it should not be really affecting computation time. Do you have a memory issue?