2
$\begingroup$

I would like to calculate mean, variance, ... of a concatenation of distributions (is this the correct technical term?). For an easy example I am trying to calculate the mean of a PoissonDistribution where the position parameter is normally distributed. The following does not produce the desired result of m:

Mean[PoissonDistribution[NormalDistribution[m, 1]]]
$\endgroup$
1
  • $\begingroup$ The general term is "hierarchical modeling". There are Frequentist and Bayesian approaches. Here's a link to a Bayesian definition: en.wikipedia.org/wiki/Bayesian_hierarchical_modeling. (Note that there are lots of other uses of the term "hierarchical modeling" so searching for that term will get you stuff that doesn't match what you want to do.) $\endgroup$ – JimB Sep 18 '20 at 16:22
7
$\begingroup$

You can use ParameterMixtureDistribution

Mean @ ParameterMixtureDistribution[PoissonDistribution[λ],
  Distributed[ λ, NormalDistribution[m, 1]]]
Undefined

We need to use a distribution with positive support for the distribution of λ:

Mean @ ParameterMixtureDistribution[PoissonDistribution[λ],
  Distributed[ λ, LogNormalDistribution[m, 1]]]
  E^(1/2 + m)
Mean @ ParameterMixtureDistribution[PoissonDistribution[λ], 
  Distributed[λ, ExponentialDistribution[τ]]]

-1 + (1 + τ)/τ

$\endgroup$
2
  • $\begingroup$ Thank you very much, ParameterMixtureDistribution was exactly what I was looking for! $\endgroup$ – jitter Sep 18 '20 at 12:41
  • $\begingroup$ @jitter, my pleasure. Thank you for the accept. And welcome to mma.se. $\endgroup$ – kglr Sep 18 '20 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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