Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagating conditions with RCD #193

Open
zenna opened this issue Mar 11, 2022 · 0 comments
Open

Propagating conditions with RCD #193

zenna opened this issue Mar 11, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@zenna
Copy link
Owner

zenna commented Mar 11, 2022

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 zenna added the bug Something isn't working label Mar 11, 2022
@zenna zenna added this to the 1.0 milestone Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant