Closed zenna closed 2 years ago
Here's how to implement a geometric distribution in Omega
geometric(p, ω, n = 0) = (n ~ Bernoulli(p))(ω) ? 0 : 1 + geometric(p, ω, n + 1)
Let's make it into a class
function geometric(p) geoclass(i, ω) = geometric(p, ω, i) something someting it gets more complicated end
It might be more convenient if we can transform ω instead
ω
geometric(p, ω) = (@~ Bernoulli(p))(ω) ? 0 : 1 + geometric(p, τ(ω))
This is easier to write, but are we opening pandora's box. In a sense, this we already have the functionality to do this with sample space projections
Here's how to implement a geometric distribution in Omega
geometric(p, ω, n = 0) = (n ~ Bernoulli(p))(ω) ? 0 : 1 + geometric(p, ω, n + 1)
Let's make it into a class
function geometric(p) geoclass(i, ω) = geometric(p, ω, i) something someting it gets more complicated end
It might be more convenient if we can transform
ω
insteadgeometric(p, ω) = (@~ Bernoulli(p))(ω) ? 0 : 1 + geometric(p, τ(ω))
This is easier to write, but are we opening pandora's box. In a sense, this we already have the functionality to do this with sample space projections