Skip to content

Return 1 from step at zero, as BUGS does - #572

Draft
shravanngoswamii wants to merge 1 commit into
mainfrom
sg/step-at-zero
Draft

shravanngoswamii wants to merge 1 commit into
mainfrom
sg/step-at-zero

Conversation

@shravanngoswamii

Copy link
Copy Markdown
Member

BUGS defines step(e) as 1 if e >= 0 (OpenBUGS manual, Appendix II), and so does JAGS.
It matters when the argument is a count. Eye Tracking's cl[j] <- step(sumSC[j] - 1) skipped every cluster with one member, so K came out low.

@github-actions

Copy link
Copy Markdown
Contributor

JuliaBUGS.jl documentation for PR #572 is available at:
https://TuringLang.github.io/JuliaBUGS.jl/previews/PR572/

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Julia 1.13.4 on AMD EPYC 7763 64-Core Processor (Linux)

Ratio = JuliaBUGS/Stan (lower is better for JuliaBUGS)

# Params shows Stan / JuliaBUGS when parameter counts differ.

Log Density uses generated evaluation. Gradient columns measure log density + gradient.

McRvs = Mooncake reverse mode with generated evaluation; FwdDiff = ForwardDiff with graph evaluation.

Model # Params Log Density Ratio McRvs Ratio FwdDiff Ratio
rats 65 0.44x 1.96x 95.05x
pumps 12 1.93x 2.51x 20.52x
bones 13 0.46x 4.21x 0.22x
oxford 244 2.09x 5.58x 657.94x
epil 303 0.61x 2.10x 968.24x
lsat 1006 0.76x 2.84x 1966.13x
schools 133 0.26x 1.68x 191.71x
beetles 2 2.61x 5.07x 10.74x
air 5 2.05x 1.91x 14.27x

Note: Stan benchmarks use hand-optimized Stan models, not direct BUGS translations. Comparison is illustrative only.

@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.08%. Comparing base (5fd788c) to head (f71244e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
- Coverage   88.49%   88.08%   -0.42%     
==========================================
  Files          30       30              
  Lines        3851     3851              
==========================================
- Hits         3408     3392      -16     
- Misses        443      459      +16     
Flag Coverage Δ
callbacks 28.50% <0.00%> (ø)
compilation_model 50.00% <100.00%> (ø)
compilation_source_gen 44.85% <100.00%> (ø)
distributed_sampling 38.55% <0.00%> (ø)
elementary 27.94% <100.00%> (+0.05%) ⬆️
frontend 47.02% <0.00%> (ø)
gibbs 39.63% <0.00%> (ø)
graphs 21.14% <0.00%> (ø)
inference_chains 37.07% <0.00%> (ø)
inference_flexichains ?
inference_hmc ?
inference_marginalization 31.10% <0.00%> (ø)
inference_mh 35.46% <0.00%> (ø)
inference_slice_sampling 26.27% <0.00%> (ø)
log_density 59.15% <0.00%> (ø)
model_operations 43.01% <0.00%> (ø)
parallel_sampling ?
params_with_stats 38.18% <0.00%> (ø)
serialization 34.28% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

1 participant