funsor icon indicating copy to clipboard operation
funsor copied to clipboard

Delta integrate pattern

Open ordabayevy opened this issue 3 years ago • 0 comments

(Separating this from #593 PR)

This proposes the following logic for the Delta Integrate pattern:

  • If reduced_var is in integrand.inputs then apply substitution to delta and integrand:
delta = Delta("x",  point, log_density)
integrand = Variable("x")
Integrate(delta, integrand, reduced_vars="x")
  => delta(x=point).exp() * integrand(x=point)
  => log_density.exp() * point

where log_density can be a Dice factor or an importance weight in general.

  • If reduced_var is not in integrand.inputs then just reduce delta:
delta = Delta("x",  point, log_density)
integrand = Number(3.0)
Integrate(delta, integrand, reduced_vars="x")
  => delta.reduce(logaddexp, "x").exp() * integrand
  => 1 * 3.0
  => 3.0

where delta is normalized.

ordabayevy avatar May 05 '22 21:05 ordabayevy