Question
How do we analyze in Mathematica cases where a parameter in a Probability Density Function (PDF) varies according to another PDF? Consider the following example...
Example
The text below contains absolutely no biological reality. I just made it up!
The size $x$ of a species of butterflies in any given population of butterflies follows a normal distribution with parameters $\mu_{pop}$ and σ. However, there are many different butterflies populations and each population has a different mean ($\mu_{pop}$) of lengths ($x$). The PDF of $\mu_{pop}$ follows an exponential distribution with parameter λ.
What is the overall PDF of $x$ (butterflies size) in all populations given the PDF of $x$ in any given population and the PDF of $\mu_{pop}$?
My Try
Below $\mu_{pop}$ is renamed µ for ease of reading.
fx[µ_, σ_] = NormalDistribution[µ, σ];
fµ[λ_] = ExponentialDistribution[λ];
fµx[µ_, σ_, λ_] =
ProductDistribution[fx[µ, σ], fµ[λ]];
PDF[fµx[µ, σ, λ], {x, µ}]
...but it is definitely not the right way of modeling this problem because what $fµx$ is some weird joint distribution while what I am looking for is not a joint distribution but I am looking for the overall PDF of $x$ given that the parameter $\mu$ is exponentially distributed among populations with parameter λ.
PDF
aroundfµx
? Why isn'tfµx
good enough? The only suggestion I have is to maybe writefµx[ƛ_][µ_, σ_]
. I think you need to explain what you're doing and why/how you're going to use thisfµx
function. Also, ƛ is a bit of an odd character to use. Why not just λ? $\endgroup$