1
$\begingroup$

Is it possible to set something like this? A probability distribution with random parameters

p = BetaDistribution[1, 1]
count = BinomialDistribution[10, p]

(* and to calculate stuff like: *)
Expectation[count]
Probability[count == 3 \[Conditioned] p > 1/2]
```
$\endgroup$

1 Answer 1

4
$\begingroup$

The probability distribution for count is

dist = ParameterMixtureDistribution[
  BinomialDistribution[10, p],
  p \[Distributed] BetaDistribution[1, 1]]

(* BetaBinomialDistribution[1, 1, 10] *)

The expected value of count is the Mean of dist

Mean[dist]

(* 5 *)

Probability[count > 1/2, count \[Distributed] dist]

(* 10/11 *)
$\endgroup$
2
  • $\begingroup$ It's exactly what I was looking for. Thank you, Bob! $\endgroup$
    – WHoZ
    Commented Sep 30, 2020 at 1:56
  • 1
    $\begingroup$ @WHoZ if you need to draw samples from both distributions, you may also be interested in the resource function ConditionalProductDistribution $\endgroup$ Commented Sep 30, 2020 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.