Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples from BUGS volume 2 #186

Merged
merged 21 commits into from
Jul 1, 2024
Merged

Add examples from BUGS volume 2 #186

merged 21 commits into from
Jul 1, 2024

Conversation

sunxd3
Copy link
Collaborator

@sunxd3 sunxd3 commented May 3, 2024

Fix #133 (also #188, which seems to be a numerical thing, fixed by using approximately equality test)

@sunxd3 sunxd3 marked this pull request as draft May 3, 2024 08:51
src/BUGSExamples/Volume_2/01_Dugongs.jl Outdated Show resolved Hide resolved
src/BUGSExamples/Volume_2/02_Orange_trees.jl Outdated Show resolved Hide resolved
sunxd3 and others added 3 commits May 3, 2024 09:56
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@coveralls
Copy link

coveralls commented May 3, 2024

Pull Request Test Coverage Report for Build 9747173277

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 82.624%

Files with Coverage Reduction New Missed Lines %
src/parser/bugs_parser.jl 1 89.06%
Totals Coverage Status
Change from base Build 9237944383: 0.05%
Covered Lines: 1436
Relevant Lines: 1738

💛 - Coveralls

src/BUGSExamples/Volume_2/04_Biopsies.jl Outdated Show resolved Hide resolved
src/BUGSExamples/Volume_2/08_Cervix.jl Outdated Show resolved Hide resolved
src/BUGSExamples/Volume_2/11_Schools.jl Outdated Show resolved Hide resolved
src/BUGSExamples/Volume_2/14_Alligators.jl Outdated Show resolved Hide resolved
sunxd3 and others added 4 commits July 1, 2024 15:41
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sunxd3 sunxd3 marked this pull request as ready for review July 1, 2024 08:20
@sunxd3 sunxd3 requested a review from yebai July 1, 2024 13:16
@yebai
Copy link
Member

yebai commented Jul 1, 2024

@sunxd3 looks good; do we cover all BUGS models in Vol 1 and Vol 2?

@sunxd3
Copy link
Collaborator Author

sunxd3 commented Jul 1, 2024

Other than the last four examples from Vol 2, all examples from Vol 1 and 2 are here. I didn't include those examples because either they are not examples on doing inferences (https://www.multibugs.org/examples/latest/Stagnant.html) or they are not very illustrative.

I tried doing HMC (or NUTS) on pretty much all the examples, the results are here. Most examples actually just work. The biggest failure mode is discrete random variable, for instance

a ~ dcat() # Categorical
b ~ dnorm(c[a], 1)

the issue here is a is casted into a float (TrackedReal), but the conversion back to Int is not defined for TrackedReal). MH with individual proposal should work, although with LogDensityProblems interface, it is not straightforward to do.

@sunxd3 sunxd3 merged commit ba3bc37 into master Jul 1, 2024
11 checks passed
@sunxd3 sunxd3 deleted the sunxd/vol_2_examples branch July 1, 2024 15:41
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.

Implement all models from WinBUGS examples.
3 participants