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]]]
  • $\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
    Commented Sep 18, 2020 at 16:22

1 Answer 1


You can use ParameterMixtureDistribution

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

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 + τ)/τ

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

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.