Closed ga72kud closed 2 years ago
here is the solution I have figured out
using StatsPlots
using Distributions
using Omega
using Random
using Flux
plot(layout=(3,1))
α=categorical([0.3, 0.7])
function x_(rng)
#α=categorical([0.1, .9])
if(α(rng)==1)
x=normal(rng, 0.3, .1)
elseif(α(rng)==2)
x=normal(rng, -0.3, .1)
elseif(α(rng)==3)
x=normal(rng, 0.0, .01)
end
end
AM_SAMPLES=10000
x = ciid(x_)
samples=[rand(x) for i=1:AM_SAMPLES]
display(histogram!(samples, subplot=1))
x_interv=replace(x, α=>categorical([0.7, 0.2, 0.1]))
samples_interv=[rand(x_interv) for i=1:AM_SAMPLES]
display(histogram!(samples_interv, subplot=2))
Thank you for the great software. I am wondering and trying to pass input random variables and using the ciid(...) function. is it possible to parse α=categorical([0.1, .9]) to ciid(..., \alpha)