0

I have two random variables:

B1 ~ Beta(α1,β1)

B2 ~ Beta(α2,β2)

I would like to compute distribution of Z = B1*B2 (the product of the random variables)

Using Julia, how can I get the pdf of a single Beta with:

x = collect(0:0.001:1);
b1 = Beta(11,41);
b2 = Beta(41,11);
posterior = pdf.(b1.*b2,x);

I get this error MethodError: no method matching *(::Distributions.Beta{Float64}, ::Distributions.Beta{Float64})

Akash
  • 395
  • 5
  • 16
  • Could you use a MixtureModel function from the Distributions package? – Bill Oct 21 '18 at 07:23
  • I don't know if this counts as a duplicate, but the [exact same thing](https://stackoverflow.com/q/21889025/1346276) has been asked for Python. Are you looking for a translation of the simulation code in the answers there, or for an implementation of an analytical solution? (The reason why `Distributions` does not provide that operator is because it's difficult in general.) – phipsgabler Oct 21 '18 at 08:38
  • @phg I am looking for implementation of an analytical solution. – Akash Oct 21 '18 at 18:14
  • 2
    I do not think there is s package providing an analytical solution to your problem. The product of two independent Beta random variables does not have a well-known distribution. There are some math.stackexchanhe questions and papers about this topic. – hckr Oct 21 '18 at 21:23

0 Answers0