# Plot a product of Beta distributions

I would like to plot the PDF of the product of a $Beta(1,1)$ and $Beta(3/2,1/2)$ random variables. I can use the following to calculate the PDF at a point $x$:

PDF[TransformedDistribution[u v, {u \[Distributed] BetaDistribution[1, 1],


However, to work out the PDF at a point (take $x=0.5$ for example), the above takes about 10 minutes on my computer.

I could leave my computer overnight, and it should be able to plot the above PDF using $Plot$, however, I was wondering whether there are any quicker alternatives?

Note: I want to plot the distribution's PDF exactly, not an approximation by drawing randomly first a $Beta(1,1)$ then multiplying it by a draw from $Beta(3/2,1/2)$, then looking at a histogram.

Best,

Ben

From what I can tell you are recalculating the transformed distribution too often in your plot. Calculate and store the resulting PDF once and then use it for your plots.

tpdf = PDF[
TransformedDistribution[
u v, {u \[Distributed] BetaDistribution[1, 1],


Once you have tpdf your plot will return immediately since you are not recalculating it for each value of x.

Plot[tpdf, {x, 0, 1}] Hope this helps.

• …and if OP would rather skip the use of an auxiliary variable, there's the option setting Evaluated -> True. Aug 11, 2015 at 16:41
• @Guesswhoitis. Is this an option on Plot? I can't seem to find it in 10.2 Aug 11, 2015 at 17:21
• @Edmund - use Plot[Evaluate[PDF[..., x]], {x, 0, 1}] Aug 11, 2015 at 18:49
• Yes, it's an option for Plot[]. Aug 12, 2015 at 0:27