Omega.jl icon indicating copy to clipboard operation
Omega.jl copied to clipboard

RID of one argument

Open zenna opened this issue 5 years ago • 1 comments

zenna avatar Dec 18 '20 21:12 zenna

In the normal normal a model:

θ = @~ Normal(0, 1)
x = @~ Normal(θ, 1)

rcd(x) should just be x || θ

In contrast, if you have A = X + Y + Z, its not clear what RCD(A) should mean

I think then that it make sense to limit RCD of one arg to members of plates

Whereby RCD(Id ~ X) is w.r.t. everything that's not in the plate. Example

e = 21 ~ Normal(0, 1)
function f(id, ω)
  a = (id, 1) ~ Normal(0, 1)
  b = (id, 2) ~ Normal(0, 1)
  c = a(ω) + b(ω) + e(ω)
end

In this case we, if we have x = 12 ~ f, and then rcd(x), we really just want \theta to include e.

  [12, 1]@StdNormal{Float64}() => 0.069282
  [21]@StdNormal{Float64}()    => -2.21076
  [12, 2]@StdNormal{Float64}() => -0.283042

Difficulties in implementation:

  1. Identifying whether a variable needs to be intervened. Can we tell this from the ids?
  2. This doesn't quite fit into the intervention interface. We don't have an explicit random variable - rather we have a predicate on random variables that says whether it should be intervened. Then we don't have a specific value, we have a kind of function that we want to execute.

So I think I should make a more general type of intervention first and formulate rid in thee terms.

As for identifying the variable, looking at the thing above it's clear that the one we want to intervene does not have 12 in it's ids. Is this robust? Let's consider possible failures

  • id has 12 in it but should be in \theta. This could happen if: : there's some parent that has the id 12. for instance if we had e = 12 ~ Normal(0, 1)
  • id does no have 12 in it but should not be in \theta. I can't think of a way in which this would happen. If it does not have 12 in it

zenna avatar Feb 26 '21 07:02 zenna