-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Massage InferenceData for multi-variable model comparison? #998
Comments
I think it is, but for now it will be convoluted and unnecessarily much more complicated than it needs to be. The first issue is getting the log_likelihood data from the PyMC3 model, for this you have to use the code in #794 (I can probably rebase and upload in some hours) or write/copy some function to get the log likelihood. The second issue is ArviZ not accepting multiple log likelihood instances, so the fastest way to get it done is probably to group all the log likelihoods into a single
Note: I would start trying if it works with |
Do you want to sum them together or compare invidually. If you can extract each cell (use Then compare pair(s). |
@ahartikainen I would like to compare the models as a whole (rather than comparing the submodels), so I think I want to do what @OriolAbril suggests: effectively concatenate all the observed random variables into one big random variable. This is reasonable, because the observations are interchangeable by the model. |
@OriolAbril I tried this, but it didn't work, because the code for
I think it might be possible to build multiple |
This is why I recommended using the code in #794 |
@OriolAbril Thanks for the reminder. I will have a careful look at #794 tomorrow. |
What do you suggest once you sent this concatenation of log_likelihood for all observed variables, to the waic function? Don't you need to sum the log_likelihoods at some point? See my comment here. |
After combining all the log_likelihood data into a single array (stored in Note: ArviZ currently looks first at sample_stats to raise a warning if log likelihood is still there, therefore, doing this will only get a deprecation warning and not the annoying |
Short Description
I have a PyMC3 model that is partitioned into 6 sub-models. The observations are also partitioned into 6 subsets. This lets me apply different parameters based on the values of independent variables without complex indexing. I can't use mixing because there is no distribution over the independent variables.
I know model comparison only works for models with a single observed RV. But I was wondering: is there some way to "unpartition" the
InferenceData
so that Arviz can treat the six vectors of observations as one big vector, and compute model comparison metrics?I can compare the submodels individually, but this does not properly take into account the hyperparameters that link them.
The text was updated successfully, but these errors were encountered: