Skip to content

Conversation

@rozyczko
Copy link
Member

Description

Added a correlation stats table in the DREAM's Result Panel tabbed widget

Fixes #2505

How Has This Been Tested?

Local dev build tests

Resulting table:

Untitled

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

  • [X ] There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

Copy link
Contributor

@wpotrzebowski wpotrzebowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works as expected, however I have some questions related to nomenclature.
It currently says Correlation Table but I think Statistics will be more appropriate here (we also have Correlation plot and it can be bit misleading in this context too).Also "best" for the parameter can probably be changed to something more accrurate. I think in Bayesian teminology it is a "point estimate". Maybe keeping "best" but adding tooltip will work.

@butlerpd
Copy link
Member

Indeed, I think the table is produced by bumps so the nomenclature in the table would have to be changed there I think? we could put an issue into bumps perhaps?

@wpotrzebowski
Copy link
Contributor

The column headings are setup on sasview end but indeed it would be good to be consistent with bumps

@rozyczko
Copy link
Member Author

The headers are based on bumps headers.
I will change the name of the tab to say "Correlation Statistics" and add a tooltip to "Best" column to say "Point estimate"

@rozyczko
Copy link
Member Author

Also, refactored the parsing out of plot() and used bumps' own method to get the values. Thanks, @wpotrzebowski !

@wpotrzebowski
Copy link
Contributor

I would suggest naming it "Parameter Statistics" or even "Statistics". Correlation suggests that it should be between two parameters and here I believe it is "per" parameter.

@pkienzle
Copy link
Contributor

These are statistics for the posterior distribution of the Bayesian inverse problem $P(M|D) \propto P(D|M) P(M)$ summarizing the population produced by Markov chain Monte Carlo sampling. In particular, they are statistics summarizing the 1-D projections of the multidimensional posterior distribution onto the individual parameter dimensions. They are definitely not correlation stats since they are only looking at one parameter at a time.

Possible names include "Statistics", "Parameter statistics", "Fit Results", "Summary Statistics".

"best" is the best value seen by the MCMC walker. It is an estimate of the parameter vector with the maximum likelihood. I figured "best" was clearer label than "MLE". I also considered "mode" to go along with "mean" and "median", but that is misleading for multimodal distributions.

@pkienzle
Copy link
Contributor

BTW, the points are still available. If you had a way to enter expressions, a user could see results for derived parameter such as the cylinder volume. We could add a standard set of derived parameters for each model and calculate them at the end of the fit.

Copy link
Contributor

@krzywon krzywon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, and the table looks good. I would suggest, if possible, we add this into the Uncertainty tab instead of its own tab since this summarizes that view anyway.

plot_corrmatrix(draw=draw, fig=self.figure)
self.canvas.draw_idle()

class CorrelationTable(QtWidgets.QWidget):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, should this be called 'CorrelationTableView'? Also, isn't this a table of the Uncertainties, so UncertaintiesTableView would make the most sense, right?

@rozyczko
Copy link
Member Author

rozyczko commented Nov 18, 2025

@pkienzle @krzywon @wpotrzebowski - can you please decide on the proper naming for the tab and its location? It seems each person has a different view :)

Copy link
Member

@butlerpd butlerpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are starting split hairs a bit here.

From what I can see there is broad agreement to NOT use the word "correlation" which I think is clear. As @pkienzle who authored the table in bumps clearly points out, this has nothing to do with correlations.

I would personally choose "statistics" from @pkienzle choices (or even "summary statistics" but I don't see the necessity of adding summary) as that is exactly what it is and it avoids duplicating the word "uncertainty" which is already used. I am however not wedded to a particular nomenclature as long as it does not involve "correlations." Another option would be "confidence intervals" which is what many people call this but I know @pkienzle has strong negative feelings about that word.

I take Jeff's point which at its core is really about the fact that all the other tabs in that panel are plots whereas this is a table. That said I think it is fine to leave it where it is, particularly with the "statistics" suggested by @pkienzle. Placing it at the bottom of the uncertainty plots I think just makes it harder to find and still makes one tab unique in that it is more than just a plot.

Bottom line, removing the "correlation" word seems to be the only real issue IMO

@rozyczko
Copy link
Member Author

The table caption currently reads "Statistics"

@krzywon
Copy link
Contributor

krzywon commented Nov 18, 2025

I was speaking to the class name, mostly, not the tab name when I suggested UncertaintiesTableView. I think the current tab name, 'Statistics', makes sense. I say we merge this as-is and can always make tweaks later if users are confused by the table.

@butlerpd
Copy link
Member

I was speaking to the class name, mostly, not the tab name when I suggested UncertaintiesTableView.

fair enough. Having correlation in the class name could cause confusion to developers I suppose if it is a statistics table I suppose? I agree though it can be merged either with or without that small change in code nomenclature as far as I'm concerned.

@pkienzle
Copy link
Contributor

The Bayesian "credible interval" is different from a "confidence interval". I'm computing the credible interval so I would prefer to use the correct terminology. I'm not against confidence intervals per se, though I do have a preference for credible intervals because I understand them.

@butlerpd
Copy link
Member

butlerpd commented Dec 1, 2025

Regarding the name of the widget, how general is it I wonder? for example if one wanted at some point in the future to show the Jacobian matrix would this widget work? If so leaving the name seems fine since in some sense correlations between parameters and uncertainties on same are ... well .. .correlated?

If however the widget is really unique to this specific table than Jeff's suggestion would probably be helpful - or even "CredibleIntervalTable"?

@krzywon krzywon mentioned this pull request Dec 3, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SasView GUI should provide access to the DREAM output on fit parameters

6 participants