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

1 Answer 1

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$ Commented Sep 18, 2020 at 12:41
  • $\begingroup$ @jitter, my pleasure. Thank you for the accept. And welcome to mma.se. $\endgroup$ Commented Sep 18, 2020 at 12:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.