Description Usage Arguments Details Value Acknowledgments Note Author(s) References See Also Examples
Density, cumulative distribution function, quantile function and
random number generation for the extreme value mixture model with mixture of gammas for bulk
distribution upto the threshold and conditional GPD for upper tail with continuity at threshold. The parameters
are the multiple gamma shapes mgshape
, scales mgscale
and mgweights
, threshold u
GPD shape xi
and tail fraction phiu
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | dmgammagpdcon(x, mgshape = 1, mgscale = 1, mgweight = NULL,
u = qgamma(0.9, mgshape[[1]], 1/mgscale[[1]]), xi = 0, phiu = TRUE,
log = FALSE)
pmgammagpdcon(q, mgshape = 1, mgscale = 1, mgweight = NULL,
u = qgamma(0.9, mgshape[[1]], 1/mgscale[[1]]), xi = 0, phiu = TRUE,
lower.tail = TRUE)
qmgammagpdcon(p, mgshape = 1, mgscale = 1, mgweight = NULL,
u = qgamma(0.9, mgshape[[1]], 1/mgscale[[1]]), xi = 0, phiu = TRUE,
lower.tail = TRUE)
rmgammagpdcon(n = 1, mgshape = 1, mgscale = 1, mgweight = NULL,
u = qgamma(0.9, mgshape[[1]], 1/mgscale[[1]]), xi = 0, phiu = TRUE)
|
x |
quantiles |
mgshape |
mgamma shape (positive) as list or vector |
mgscale |
mgamma scale (positive) as list or vector |
mgweight |
mgamma weights (positive) as list or vector ( |
u |
threshold |
xi |
shape parameter |
phiu |
probability of being above threshold [0, 1] or |
log |
logical, if TRUE then log density |
q |
quantiles |
lower.tail |
logical, if FALSE then upper tail probabilities |
p |
cumulative probabilities |
n |
sample size (positive integer) |
Extreme value mixture model combining mixture of gammas for the bulk below the threshold and GPD for upper tail with continuity at threshold.
The user can pre-specify phiu
permitting a parameterised value for the tail
fraction φ_u. Alternatively, when phiu=TRUE
the tail fraction is
estimated as the tail fraction from the mixture of gammas bulk model.
Suppose there are M>=1 gamma components in the mixture model. If you
wish to have a single (scalar) value for each parameter within each of the
M components then these can be input as a vector of length M. If
you wish to input a vector of values for each parameter within each of the
M components, then they are input as a list with each entry the
parameter object for each component (which can either be a scalar or
vector as usual). No matter whether they are input as a vector or list there
must be M elements in mgshape
and mgscale
, one for each
gamma mixture component. Further, any vectors in the list of parameters must
of the same length of the x, q, p
or equal to the sample size n
, where
relevant.
If mgweight=NULL
then equal weights for each component are assumed. Otherwise,
mgweight
must be a list of the same length as mgshape
and
mgscale
, filled with positive values. In the latter case, the weights are rescaled
to sum to unity.
The cumulative distribution function with tail fraction φ_u defined by the
upper tail fraction of the mixture of gammas bulk model (phiu=TRUE
), upto the
threshold 0 < x ≤ u, given by:
F(x) = H(x)
and above the threshold x > u:
F(x) = H(u) + [1 - H(u)] G(x)
where H(x) and G(X) are the mixture of gammas and conditional GPD cumulative distribution functions.
The cumulative distribution function for pre-specified φ_u, upto the threshold 0 < x ≤ u, is given by:
F(x) = (1 - φ_u) H(x)/H(u)
and above the threshold x > u:
F(x) = φ_u + [1 - φ_u] G(x)
Notice that these definitions are equivalent when φ_u = 1 - H(u).
The continuity constraint means that (1 - φ_u) h(u)/H(u) = φ_u g(u) where h(x) and g(x) are the mixture of gammas and conditional GPD density functions respectively. The resulting GPD scale parameter is then:
σ_u = φ_u H(u) / [1 - φ_u] h(u)
. In the special case of where the tail fraction is defined by the bulk model this reduces to
σ_u = [1 - H(u)] / h(u)
.
The gamma is defined on the non-negative reals, so the threshold must be positive. Though behaviour at zero depends on the shape (α):
f(0+)=∞ for 0<α<1;
f(0+)=1/β for α=1 (exponential);
f(0+)=0 for α>1;
where β is the scale parameter.
See gammagpd
for details of simpler parametric mixture model
with single gamma for bulk component and GPD for upper tail.
dmgammagpdcon
gives the density,
pmgammagpdcon
gives the cumulative distribution function,
qmgammagpdcon
gives the quantile function and
rmgammagpdcon
gives a random sample.
Thanks to Daniela Laas, University of St Gallen, Switzerland for reporting various bugs in these functions.
All inputs are vectorised except log
and lower.tail
, and the gamma mixture
parameters can be vectorised within the list. The main inputs (x
, p
or q
)
and parameters must be either a scalar or a vector. If vectors are provided they must all be
of the same length, and the function will be evaluated for each element of vector. In the case of
rmgammagpdcon
any input vector must be of length n
.
Default values are provided for all inputs, except for the fundamentals
x
, q
and p
. The default sample size for
rmgammagpdcon
is 1.
Missing (NA
) and Not-a-Number (NaN
) values in x
,
p
and q
are passed through as is and infinite values are set to
NA
. None of these are not permitted for the parameters.
Error checking of the inputs (e.g. invalid probabilities) is carried out and will either stop or give warning message as appropriate.
Carl Scarrott carl.scarrott@canterbury.ac.nz
http://www.math.canterbury.ac.nz/~c.scarrott/evmix
http://en.wikipedia.org/wiki/Gamma_distribution
http://en.wikipedia.org/wiki/Generalized_Pareto_distribution
http://en.wikipedia.org/wiki/Mixture_model
McLachlan, G.J. and Peel, D. (2000). Finite Mixture Models. Wiley.
Scarrott, C.J. and MacDonald, A. (2012). A review of extreme value threshold estimation and uncertainty quantification. REVSTAT - Statistical Journal 10(1), 33-59. Available from http://www.ine.pt/revstat/pdf/rs120102.pdf
do Nascimento, F.F., Gamerman, D. and Lopes, H.F. (2011). A semiparametric Bayesian approach to extreme value estimation. Statistical Computing, 22(2), 661-675.
Other gammagpdcon: fgammagpdcon
,
fgammagpd
, fmgammagpdcon
,
gammagpdcon
, gammagpd
Other mgamma: fmgammagpdcon
,
fmgammagpd
, fmgamma
,
mgammagpd
, mgamma
Other mgammagpd: fgammagpd
,
fmgammagpdcon
, fmgammagpd
,
fmgamma
, gammagpd
,
mgammagpd
, mgamma
Other mgammagpdcon: fgammagpdcon
,
fmgammagpdcon
, fmgammagpd
,
fmgamma
, gammagpdcon
,
mgammagpd
, mgamma
Other fmgammagpdcon: fmgammagpdcon
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
set.seed(1)
par(mfrow = c(1, 1))
x = rmgammagpdcon(1000, mgshape = c(1, 6), mgscale = c(1, 2), mgweight = c(1, 2), u = 15, xi = 0)
xx = seq(-1, 40, 0.01)
hist(x, breaks = 100, freq = FALSE, xlim = c(-1, 40))
lines(xx, dmgammagpdcon(xx, mgshape = c(1, 6), mgscale = c(1, 2), mgweight = c(1, 2),
u = 15, xi = 0))
abline(v = 15)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.