
The gamma mixture density and auxiliary functions.
mixgamma(..., param = c("ab", "ms", "mn"), likelihood = c("poisson",
"exp"))ms2gamma(m, s, drop = TRUE)
mn2gamma(m, n, likelihood = c("poisson", "exp"), drop = TRUE)
# S3 method for gammaMix
summary(object, probs = c(0.025, 0.5, 0.975), ...)
# S3 method for gammaPoissonMix
summary(object, probs = c(0.025, 0.5, 0.975),
...)
List of mixture components.
Determines how the parameters in the list are interpreted. See details.
Defines with what likelihood the Gamma density is used (Poisson or Exp). Defaults to poisson
.
Vector of means of the Gamma mixture components
Vector of standard deviations of the gamma mixture components,
Delete the dimensions of an array which have only one level.
Vector of sample sizes of the Gamma mixture components.
Gamma mixture object.
Quantiles reported by the summary
function.
mixgamma
returns a gamma mixture with the specified mixture components.
ms2gamma
and
mn2gamma
return the equivalent natural a
and b
parametrization given
parameters m
, s
, or n
.
Each entry in the ...
argument list is expected to
be a triplet of numbers which defines the weight
The first and second parameter can be given in different
parametrizations which is set by the param
option:
Natural parametrization of Gamma density (a
=shape and b
=rate). Default.
Mean and standard deviation,
Mean and number of observations. Translation to natural
parameter depends on the likelihood
argument. For a Poisson
likelihood
Other mixdist: mixbeta
,
mixcombine
, mixnorm
,
mix
, plot.mix
# NOT RUN {
# Gamma mixture with robust and informative component
gmix <- mixgamma(rob=c(0.3, 20, 4), inf=c(0.7, 50, 10))
# objects can be printed
gmix
# or explicitly
print(gmix)
# summaries are defined
summary(gmix)
# sub-components may be extracted
# by component number
gmix[[2]]
# or component name
gmix[["inf"]]
# alternative mean and standard deviation parametrization
gmsMix <- mixgamma(rob=c(0.5, 8, 0.5), inf=c(0.5, 9, 2), param="ms")
# or mean and number of observations parametrization
gmnMix <- mixgamma(rob=c(0.2, 2, 1), inf=c(0.8, 2, 5), param="mn")
# and mixed parametrizations are also possible
gfmix <- mixgamma(rob1=c(0.15, mn2gamma(2, 1)), rob2=c(0.15, ms2gamma(2, 5)), inf=c(0.7, 50, 10))
# }
Run the code above in your browser using DataLab