-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Adding simple, multiple and hierarchical regression plots #512
Comments
Sounds great. I think we need to think API carefully. |
Great, if the other devs agree I can start to think about it but it surely will take some time. |
Sure, no problem. Do you have some model(s) you can share that could be used as a reference? Also, do you think |
This will be a great addition to ArviZ. @GWeindel please be sure to check |
I am starting to have some doubts about the feasibility. It appears to me that either one constructs a post-fit structure which then needs a lot of information about the fitted object (increasing users time and effort), or one has to master what goes in (e.g. stan or PYMC3 code) and what goes out to draw these plots. |
What if we start with regression plot done with InferenceData? So user needs to add at creation step the following information Scatter information:
Model information (Line plot)
Then we need to define same stuff as in |
After that we could implement multiple regression (where each dimension is either a new axis, or something similar) And later do hierachical structure. Let's assume user can provide data. |
I was doing something simple today: linear regression... It does get complicated fast. We need a better interface to describe our models Like getting the following to work is not hard
What is more or less hard
It would be great to give a function or something similar
and then m, x, and b are found from posterior. Also I'm not sure, but there could still be better interface:
Could this work with glm also? If we assume InferenceData has all the needed data, we just need to parse the function and also accept numpy functions inside the
How hard would it if we did that parsing with re?
Then after we have
|
Speaking of which, I was wondering is there currently in arviz something like regplot in seaborn? That would be great and that could also give a beginning to what has been asked here. |
Just a thought. |
The problem is that there is no way to know what |
@ahartikainen This is an example |
good question. I think we need to calculate the posterior predictive with python. |
https://gist.github.com/utkarsh-maheshwari/8d4cd2fd84c763bf85291c3f0881d588 Here is my initial try for visualization of linear regression models inspired by |
Use
so
will work with xarray out of the box and avoid the need to loop for computation, Ari's function above has an example with stacking to get a random subsample. Also bit of a side note, |
@OriolAbril Thank you for the suggestions. Made the suggested changes. Now there are many points that are needed to be considered for the function
Open to suggestions |
I guess, using @ahartikainen, about the y_model, I think we can do it like this? Should I open a new issue to discuss particularly |
I think data could be in constant_data as well. |
I have tried to modified the Ari's
input :
|
Can we use pm.sample_posterior_predective() to calculate it? |
It depends what PPL you use for the model |
I have written some functions to draw regression plots from mixed models fitted in pure Stan. I wonder whether creating a branch in arviz for such plots would be interesting (guess so by seeing request #313). The basic idea would be to have the possibility of plotting linear (at least) regression, simple effects, interaction effects, with or without random effects (like sjPlot in R ).
If such a project would fit in the arviz package I could begin to code it, but I would definitely benefit from people with stronger skills.
The text was updated successfully, but these errors were encountered: