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

Propagating conditions with RCD

Open zenna opened this issue 3 years ago • 0 comments

One of the things that concerns me is that I think it's possible for RCD to be incorrect in the sense that an inner expectation does not take into account external conditions.

julia> ϵ = @~ Normal(0, 1)
julia> μ = @~ Categorical([0.1, 0.3, 0.6])
julia> x = pw(+, μ, ϵ)
julia> 𝔼(x; k=1_000) = randsample(Random.MersennteTwister(0), x, k)
julia> using Random
julia> 𝔼(x; k=1_000) = mean(randsample(Random.MersenneTwister(0), x, k))
julia> pw(𝔼, rid(x, μ))
julia> UnicodePlots.histogram(randsample(pw(𝔼, rid(x, μ)), 1000))
UnicodePlots.histogram(randsample(pw(𝔼, rid(x, μ)) |ᶜ (ϵ >ₚ 0.0), 1000))
UnicodePlots.histogram(randsample(pw(𝔼, rid(x |ᶜ (ϵ >ₚ 0.0), μ)), 1000))

Point is that the last two plots are different, and that the last one is correct.

zenna avatar Mar 11 '22 11:03 zenna