You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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
Describe the bug
For simple math distributions like
dnExp
anddnNorm
, 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 likednBDP
.To reproduce
Expected behavior
In the code above, the output of
a.probability()
andb
(as well as ofa.lnProbability()
andc
) 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).The text was updated successfully, but these errors were encountered: