Functions of Distributions vs. Distributions of Function Values #1447
RationalityEnhancement
started this conversation in
Bugs
Replies: 1 comment 1 reply
-
|
Hey Falk! I might be confused, but I don't know why your observation is a distribution, shouldn't it be a scalar? Turning this into a scalar fixes this issue. If I'm wrong, and it makes sense for your observation to be a distribution. Then I'm not sure what you mean by that. Do you mean you want to run it as if you had x many observations that were sampled from the observation dist? If so, then how many? That would change the answer dramatically. If you want I can show you the code for this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use Squiggle to compute E[f(P(X))] where P(x) is a probability distribution that depends on the value x of the random variable X. What I want Squiggle to do is compute f(P(x)) for each sample x and then average the resulting scalars. Instead, Squiggle seems to compute f(mx(P(x1), P(x2), ...)). This leads to an entirely different result from what I expected.
To illustrate the problem, I have created the following example. The code is supposed to compute the distribution of the width of the 95% credible interval for the posterior distribution that you get by combining a standard normal prior with an extremely precise likelihood function. The correct answer is that it should always be extremely small. However, the answer I get from Squiggle is 2.3. I think this happens because Squiggle computes the quantile range of the mixture distribution instead of computing the quantile range for each distribution separately and then returning those value as a distribution.
I would very much appreciate if someone could either help me understand how I can get Squiggle to do what I want it to do or point out that this is not possible and that I should use a different tool instead.
Beta Was this translation helpful? Give feedback.
All reactions