Skip to content

Safer treatment of parameters out of boundaries#209

Open
mhliu0001 wants to merge 3 commits intomasterfrom
safe_plugins
Open

Safer treatment of parameters out of boundaries#209
mhliu0001 wants to merge 3 commits intomasterfrom
safe_plugins

Conversation

@mhliu0001
Copy link
Contributor

Sometimes the parameters proposed by the MCMC are too extreme and fall outside the allowed bounds. In the current implementation, the simulation is still executed in this case. This behavior both wastes computing resources and risks breaking the simulation, since the code is JIT-compiled and does not validate whether invalid parameters are passed to operations such as jnp.random.binomial.

This PR proposes to skip the simulation step entirely when the proposed parameters are out of bounds. In addition, it issues a warning when the number of simulated events in a given bin is zero, so that users can address the issue more promptly—for example, by increasing the batch_size or by imposing more restrictive bounds on the parameters.

@mhliu0001 mhliu0001 requested a review from dachengx January 14, 2026 18:48
@coveralls
Copy link

coveralls commented Jan 14, 2026

Pull Request Test Coverage Report for Build 21007291517

Details

  • 9 of 9 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.004%) to 84.122%

Files with Coverage Reduction New Missed Lines %
appletree/likelihood.py 1 85.76%
Totals Coverage Status
Change from base Build 18637300865: 0.004%
Covered Lines: 2437
Relevant Lines: 2897

💛 - Coveralls

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