Open fsaad opened 8 years ago
The functionality as specified can be implemented easily with an addition to the inference prelude, along the lines of
(lambda (scope block)
(do (joint <- (log_joint_at scope block))
(likelihood <- (log_likelihood_at scope block))
(return (- joint likelihood))))
However, semantically speaking, that would be needlessly sensitive to
x
that cannot be assessed for whatever reason)log_joint_at
due to #211 c
(asymptotic of c
is much larger than x
)It should be possible to obtain the same feature by just a detach-regen cycle on a funny scaffold whose absorbing border were exactly x
and which had no principal nodes.
It should also be possible to obtain this feature by a detach-regen cycle an a (different) funny scaffold with principal nodes x
and a hard stop without finding any absorbing border. The hard stop is safe because the values of x
are not being changed; the actual number would be computed by making a "proposal" to deterministically set x
to the values it currently has, with DeterministicLKernel
.
Opinions on which path to take? One expedient would be to add the compound definition and file the primitive one as a separate performance and robustness improvement ticket. @fsaad , did you say you had unit tests?
It should be possible to obtain the same feature by just a detach-regen cycle on a funny scaffold whose absorbing border were exactly x and which had no principal nodes.
Does this actually work in the case where x contains multiple exchangeably-coupled applications?
Should. Detach should unincorporate and regen reincorporate properly.
Also part of #570.
crashes from log_joint_at (#211) now fixed.
Marking as important for PPAML, for logpdf
of cgpms.
Does that label reflect well what you meant?
Sounds right, as impeding is weaker than blocking. [[Edit: Or is it not?]]]
Following on https://github.com/probcomp/Venturecxx/issues/197. Letting
x
be the variables in (scope, block),q
arex
parents, andc
are the children, we have:p(x|q)p(c|x)
p(c|x)
To complete the symmetry, we require something which computes
p(x|q)
p(x|q)
The easiest way to implement this is through the identity:
except you can't subtract VentureRecords, but the idea is clear.
I wrote simple programs that verify the current software does the right thing (that log_joint minus log_likelihood is equal to a manually computed log_density) and I will convert them into Venture tests for the test suite in the near future. It might fail in more complex cases though which I do not know about.
Aside: I think that
log_likelihood
is a good name since it computes probability of the childrenc
given the nodesx
, i.e.L(x) = p(c|x)
, and does not claim to be a density anyway in its name. We might want to emphasize thatlog_joint_at
is a density as well.