Venturecxx icon indicating copy to clipboard operation
Venturecxx copied to clipboard

global_log_likelihood does not include constrained choices with no random choices behind them

Open lenaqr opened this issue 9 years ago • 3 comments

venture[script] > observe (normal 0 1) 10
venture[script] > global_log_likelihood
[0]

This is because global_log_likelihood is implemented in terms of regen, and regen only ever cares about things that are downstream of random choices.

Somewhat justified because global_log_likelihood is only defined up to a constant with respect to the current model program anyway, but has the potential to be confusing.

lenaqr avatar Jan 03 '16 21:01 lenaqr

(I thought I had filed an issue for this already, but I can't find it now...)

lenaqr avatar Jan 03 '16 21:01 lenaqr

Generic workaround: force a fake random choice:

venture[script] > observe normal(exactly(0), 1) = 10
venture[script] > global_log_likelihood
[-50.918938533204674]

axch avatar Jan 04 '16 15:01 axch

This is a mirror of the problem I had with Stan doing the same thing. If we are interested in Venture-RIPL models being usable as components of other probabilistic systems, we should probably address this (for example, by adding those exactly wrappers around input "from the outside world").

axch avatar May 23 '16 18:05 axch