Density, distribution function, quantile function and random generation for the mixture of Gamma distribution.
dmgamma(x, mu, eta, w, log = FALSE)pmgamma(q, mu, eta, w, lower.tail = TRUE)
qmgamma(p, mu, eta, w, lower.tail = TRUE)
rmgamma(N, mu, eta, w)
dmgamma gives the density, pmgamma gives the distribution function, qmgamma gives the quantile function, and rmgamma generates random deviates.
The length of the result is determined by N for rmgamma and by the length of x, q or p otherwise.
vector of quantiles.
means of the gamma mixture components (vector).
shapes of the gamma mixture components (vector).
weights of the gamma mixture components (vector). Must sum to one.
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are \(P(X\leq x)\) otherwise \(P(X>x)\).
vector of probabilities.
number of observations.
The Gamma distribution has density $$f_{GA}(x|\mu,\eta)= \frac{(\eta/\mu)^\eta}{\Gamma(\eta)}x^{\eta-1}\exp(-(\eta/\mu)x), \hspace{1cm} x>0,$$ where \(\mu>0\) is the mean of the distribution and \(\eta>0\) is its shape. The density of a mixture of Gamma distributions with \(k\) components is defined as $$f_{MG}(x|\mu,\eta,w)=\sum_{i=1}^k w_if_{GA}(x|\mu_i,\eta_i),$$ where \(w_i,\mu_i,\eta_i >0\), for \(i=1,\dots,k\), \(w_1+\cdots+w_k=1\), \(\mu=(\mu_1,\dots,\mu_k)\), \(\eta = (\eta_1,\dots,\eta_k)\) and \(w=(w_1,\dots,w_k)\).
Wiper, Michael, David Rios Insua, and Fabrizio Ruggeri. "Mixtures of gamma distributions with applications." Journal of Computational and Graphical Statistics 10.3 (2001): 440-454.
dmgamma(3, mu = c(2,3), eta = c(1,2), w = c(0.3,0.7))
Run the code above in your browser using DataLab