-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
mcmc_pairs bivariate off-diagonal plot axis incorrect. #132
Comments
Thanks for the report. It'd help to label the axes in the scatterplots. Are the histograms combining the draws from from both scatterplots? If so, I don't see anything wrong witht his plot other than that it's confusing having both histograms be aligned along the x axis and to have the scales not line up). |
@strahl2e thanks for reporting. @bob-carpenter Yes, the histograms along the diagonal combine all the draws. I do think the axes are a bit confusing but I often find it nice to let them vary freely based on the contents of the plot. What if I add arguments that allow the user to specify whether the shared axes should or should not be the same across the plots? |
The first thing that made me think this was wrong is how it was different from the Stan version of pairs for the same data: Note: I had to recreate the above pairs plot from the Stan model, so it isn't exactly the same as the attached data in the original post - I've attached a link to this data below. Interestingly this example produces an even more confusing BayesPlot: The data for the above is here: https://drive.google.com/file/d/11Hcfs2D3BRH9XBJ5r2hoH5r5-2BltZZ8/view?usp=sharing I understand that the difference is that mcmc_pairs is using half or so chains for one off-diagonal plot and the remaining chains for the other off-diagonal plot and so it can be that half the chains fit one mode and the remaining chains fit another, that I think is exactly what has happened here. I think this is very useful, to visualise what subsets of the chains are doing. But, I think the axes should be for the full space, of all modes, and then it is clear which mode is being fit by each subset of chains, plus it will line up with the histogram plots. The chains for this data look like this btw: |
The axes need to vary in scale or some will be just dots. It's the rotation that's hard for me to follow. I don't see any way around that.
… On Dec 19, 2017, at 1:33 PM, Jonah Gabry ***@***.***> wrote:
@strahl2e thanks for reporting.
@bob-carpenter Yes, the histograms along the diagonal combine all the draws.
I do think the axes are a bit confusing but I often find it nice to let them vary freely based on the contents of the plot. What if I add arguments that allow the user to specify whether the shared axes should or should not be the same across the plots?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@bob-carpenter Looking at the Stan pairs plot I think it is clear that on the right the histogram below lines up with the bivariate samples plotted above. It clearly shows the aliasing close to zero. I can see that in the mcmc version but it takes a bit longer to check the axes values and imagine the full plot. @jgabry The idea of an option to align the axes sounds helpful, at least for me (and likely others) to understand the plot it would help. |
Was just bitten by this slightly. I'll just add an even simpler example: N <- 1000
dd <- posterior::draws_array(a = c(runif(N * 2) * 0.5, runif(N * 2) * 0.5 + 0.5),
b = c(runif(N * 2) * 0.5, runif(N * 2) * 0.5 + 0.5),
.nchains = 4
)
bayesplot::mcmc_pairs(dd) Produces a plot where you need to compare the scale labels to see any sort of an issue: While there in fact is a substantial issue: bayesplot::mcmc_pairs(dd, condition = bayesplot::pairs_condition(chains = list(c(1,3), c(2,4)))) |
Data file: https://drive.google.com/open?id=1pnAUDCz9uscccSaUISodF9cqGF23uNzU
Off-diagonal bivariate scatter plot axes are out of line
My understanding from the documentation is that half the chains are used for each of the off-diagonal plots. In this example case (see posterior data file linked above) the chains have not converged and so the lower off-diagonal plot seems to be using chains that only sampled from one mode, using default condition I think this should be correct. I believe the x-axis should be inline with the above univariate marginal plot and the y-axis inline scaled as the x-axis of the upper off-diagonal bivariate plot?
The text was updated successfully, but these errors were encountered: