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

[BUG] Can't store densities of simple math distributions in a deterministic node #425

Open
davidcerny opened this issue Jan 26, 2024 · 0 comments

Comments

@davidcerny
Copy link
Contributor

davidcerny commented Jan 26, 2024

Describe the bug
For simple math distributions like dnExp and dnNorm, the output of the .probability() and .lnProbability() methods can't be stored in a deterministic node. Interestingly, it is possible to do this for more complex distributions like dnBDP.

To reproduce

> seed(12345)
> a ~ dnExp(1.0)
> b := a.probability()
> c := a.lnProbability()
> a
   0.07298359
> a.probability()
   0.9296161
> b
   0.9296161
> a.lnProbability()
   -0.07298359
> c
   -0.07298359
> a ~ dnExp(1.0)
> a
   0.11636
> a.probability()
   0.8901547
> b
   0.9296161
> a.lnProbability()
   -0.11636
> c
   -0.07298359

Expected behavior
In the code above, the output of a.probability() and b (as well as of a.lnProbability() and c) should be identical after each redraw.

Computer info
macOS 12.7.1, RevBayes 1.2.2, latest version of the development branch (rapture-2386-g54c6ba).

@davidcerny davidcerny changed the title [BUG] Can't store densities of simple math distribution in a deterministic node [BUG] Can't store densities of simple math distributions in a deterministic node Jan 26, 2024
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

No branches or pull requests

1 participant