Skip to content

Bayesian analysis - #309

Merged
rozyczko merged 26 commits into
developfrom
bayesian
Aug 3, 2026
Merged

Bayesian analysis#309
rozyczko merged 26 commits into
developfrom
bayesian

Conversation

@rozyczko

Copy link
Copy Markdown
Member

This pull request introduces initial support for Bayesian (DREAM) sampling in the EasyReflectometryApp, including state management for Bayesian hyperparameters and results, integration into the minimizer selection logic, and the addition of posterior predictive overlays for both reflectivity and SLD plots. The changes span both Python backend logic and QML frontend state, laying the groundwork for Bayesian workflows and visualization.

Bayesian Sampling State & Logic

  • Added a new Bayesian state container class to manage DREAM hyperparameters (samples, burn-in, population, thinning, initializer) and posterior results, including cached plot URLs and diagnostics. This class ensures proper validation and encapsulation of Bayesian-related state.

  • Extended the fitting logic to support Bayesian sampling, including progress tracking, experiment data aggregation for sampling, and new methods for preparing and handling sampling runs and results.
    Minimizer Selection Integration

  • Updated the minimizer logic to prepend a Bayesian sentinel entry to the available minimizers list, allowing users to select Bayesian sampling as a minimization option. Added methods to check if Bayesian is selected and to ensure the correct underlying engine is used.

Frontend State & Property Additions (QML/Qt)

  • Added new read-only properties and signals to the mock Analysis.qml and Plotting.qml backends for Bayesian state (e.g., isBayesianSelected, bayesianSamples, bayesianPosterior, bayesianResultAvailable, and related plot URLs/diagnostics), as well as setter functions for Bayesian parameters.
  • Added properties and signals for posterior predictive overlays (reflectivity and SLD) in both Python and QML plotting backends, enabling frontend display and updates of Bayesian-derived uncertainty bands.

Miscellaneous

  • Minor import adjustment in fitting.py to ensure scipp is available for Bayesian data aggregation.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon labels May 21, 2026
@rozyczko
rozyczko merged commit 1418142 into develop Aug 3, 2026
16 checks passed
rozyczko added a commit that referenced this pull request Aug 3, 2026
* summary prettified (#308)

* summary prettified

* minor fixes after code review

* make links clickable (#310)

* Bayesian analysis (#309)

* initial version.

* updates to the parameter passing

* nice Bayesian sub-tabs display

* add parameter names, add cancellation of sampling, add number of steps
in status bar

* correct parenting

* added required dependencies and modified Fit Status dialog

* add save button to the plots

* added tests for bayesian logic

* attempt at getting posterior median and credibility intervals on the
main chart

* enable/disable legends on bayesian sampling

* reload bumps images on recalculation. Use different caption when running
sampling

* updates and changes, new unit tests and GUI elements. New colors

* fixed typo

* actually sample multiple experiments

* nicer plots

* trace plot - nice display

* updated plots

* changes for the new EasyList based reflectometry-lib

* changes after updates to core

* unit test fixed

* weird conflict

* Bayesian fixes (#332)

* removed MD file, fixed #312

* fixed #313

* Fixed issues #312 - #322
Temporarily commented out code signing

* Addressed issues #323, #324, #325, #326

* addressed #327, #328, #329

* update paths in the Summary textboxes

* minor updates based on the new ERL

* summary results now show correct GoF #375

* reparent to released lib

* fixes from code review (#334)

* updated versioning (#335)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] high Should be prioritized soon [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant