Reputation: 301
How to generate random numbers with bivariate gamma distribution. The density is:
F(X, Y)(x, y) = αp+qxp-1(y-x)q-1e-αy / [Γ(p) Γ(q)], 𝕀0≤ x≤ y
With y>x>0, α>0, p>0 and q>0.
I did not find any package on R that does this and nothing in literature.
Upvotes: 2
Views: 1871
Reputation: 8252
This is straightforward:
Generate X~ Gamma(p,alpha) (alpha being the rate parameter in your formulation)
Generate W~ Gamma(q,alpha), independent of X
Calculate Y=X+W
(X,Y) have the required bivariate distribution.
in R (assuming p,q,alpha and n are already defined):
x <- rgamma(n,p,alpha)
y <- x + rgamma(n,q,alpha)
generates n values from the bivariate distribution with parameters p,q,alpha
Upvotes: 1