View source: R/MGFmixedgamma.R
| MGFmixedgamma | R Documentation | 
Evaluate the moment generating function (MGF) of the mixed gamma distribution or a derivative of the MGF
MGFmixedgamma(x, prob, rate, shape, deriv = 0)
x | 
 The value at which to evaluate the MGF  | 
prob | 
 A vector of probabilities of following each gamma distribution in the mixture  | 
rate | 
 A vector of rate parameter values for each gamma distribution in the mixture  | 
shape | 
 A vector of shape parameter values for each gamma distribution in the mixture  | 
deriv | 
 An integer, the number of derivatives of the MGF to apply  | 
The number resulting from the function evaluation
# MGF of a 40/60 mixture of two gamma distributions, evaluated at -0.1:
MGFmixedgamma(-0.1, prob = c(0.4,0.6), rate = c(0.4,0.7), shape = c(0.5,3))
# Second moment of the distribution (second derivative evaluated at zero):
MGFmixedgamma(0, prob = c(0.4,0.6), rate = c(0.4,0.7), shape = c(0.5,3), deriv = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.