Skip to content

[FEATURE] Add functions for Simulation-Based Calibration (SBC) analysis#36

Merged
cmt2 merged 11 commits into
revbayes:developmentfrom
basantakhakurel:development
Oct 3, 2025
Merged

[FEATURE] Add functions for Simulation-Based Calibration (SBC) analysis#36
cmt2 merged 11 commits into
revbayes:developmentfrom
basantakhakurel:development

Conversation

@basantakhakurel

@basantakhakurel basantakhakurel commented Oct 3, 2025

Copy link
Copy Markdown

Hi,

This PR introduces a new workflow for processign and visualizing Simulation-Based Calibration results for validating models implemented in RevBayes.

This new functionality is encapsulated in two new exported functions: processSBC() and plotSBC().

Summary of changes:

  • processSBC(): A new function that reads the output directory of RevBayes validation analysis.
  • plotSBC(): A new plotting function that creates ggplot objects that compare the observed coverage probability to the expected probability.
  • Documentation: Both functions are documented with proper descriptions of parameters and runnable examples in the documentation.
  • Dependency: coda package has been added to the DESCRIPTION file.
    This addition provides the model validation procedure directly within the RevGadgets ecosystem.

Additionally, I realized that the unit tests via GitHub Actions were failing during the installation of the ggtree package due to a version conflict with ggplot2.
A globally set R_BIOC_VERSION: 3.19 was forcing the jobs running to fetch incompatible packages from Bioconductor.

To resolve this and hopefully improve future stability, this PR:

  • Removes the R_BIOC_VERSION override from the workflow file.
  • Introduces a pkg.lock file to prevent this kind of 'dependency drift' from causing issues in the future.

I plan to write a detailed guide on troubleshooting these type of issues to the Developer Guide in a separate, follow-up PR.
EDIT: I managed to put it in the latest commit in this PR.

I hope this will be a useful contribution to the package.

@cmt2 cmt2 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Basanta, looks great!

@cmt2 cmt2 merged commit 9dfd073 into revbayes:development Oct 3, 2025
4 checks passed
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.

2 participants