
Maximum likelihood estimation for fitting the extreme value mixture model with Weibull for bulk distribution upto the threshold and conditional GPD above threshold. With options for profile likelihood estimation for threshold and fixed threshold approach.
fweibullgpd(x, phiu = TRUE, useq = NULL, fixedu = FALSE,
pvector = NULL, std.err = TRUE, method = "BFGS",
control = list(maxit = 10000), finitelik = TRUE, ...)lweibullgpd(x, wshape = 1, wscale = 1, u = qweibull(0.9, wshape,
wscale), sigmau = sqrt(wscale^2 * gamma(1 + 2/wshape) - (wscale *
gamma(1 + 1/wshape))^2), xi = 0, phiu = TRUE, log = TRUE)
nlweibullgpd(pvector, x, phiu = TRUE, finitelik = FALSE)
profluweibullgpd(u, pvector, x, phiu = TRUE, method = "BFGS",
control = list(maxit = 10000), finitelik = TRUE, ...)
nluweibullgpd(pvector, u, x, phiu = TRUE, finitelik = FALSE)
vector of sample data
probability of being above threshold fnormgpd
vector of thresholds (or scalar) to be considered in profile likelihood or
NULL for no profile likelihood
logical, should threshold be fixed (at either scalar value in useq,
or estimated from maximum of profile likelihood evaluated at
sequence of thresholds in useq)
vector of initial values of parameters or NULL for default
values, see below
logical, should standard errors be calculated
optimisation method (see optim)
optimisation control list (see optim)
logical, should log-likelihood return finite value for invalid parameters
optional inputs passed to optim
scalar Weibull shape (positive)
scalar Weibull scale (positive)
scalar threshold value
scalar scale parameter (positive)
scalar shape parameter
logical, if TRUE then log-likelihood rather than likelihood is output
Log-likelihood is given by lweibullgpd and it's
wrappers for negative log-likelihood from nlweibullgpd
and nluweibullgpd. Profile likelihood for single
threshold given by profluweibullgpd. Fitting function
fweibullgpd returns a simple list with the
following elements
call: |
optim call |
x: |
data vector x |
init: |
pvector |
fixedu: |
fixed threshold, logical |
useq: |
threshold vector for profile likelihood or scalar for fixed threshold |
nllhuseq: |
profile negative log-likelihood at each threshold in useq |
optim: |
complete optim output |
mle: |
vector of MLE of parameters |
cov: |
variance-covariance matrix of MLE of parameters |
se: |
vector of standard errors of MLE of parameters |
rate: |
phiu to be consistent with evd |
nllh: |
minimum negative log-likelihood |
n: |
total sample size |
wshape: |
MLE of Weibull shape |
wscale: |
MLE of Weibull scale |
u: |
threshold (fixed or MLE) |
sigmau: |
MLE of GPD scale |
xi: |
MLE of GPD shape |
phiu: |
MLE of tail fraction (bulk model or parameterised approach) |
se.phiu: |
standard error of MLE of tail fraction |
See Acknowledgments in
fnormgpd, type help fnormgpd.
The extreme value mixture model with Weibull bulk and GPD tail is fitted to the entire dataset using maximum likelihood estimation. The estimated parameters, variance-covariance matrix and their standard errors are automatically output.
See help for fnormgpd for details, type help fnormgpd.
Only the different features are outlined below for brevity.
The full parameter vector is
(wshape, wscale, u, sigmau, xi) if threshold is also estimated and
(wshape, wscale, sigmau, xi) for profile likelihood or fixed threshold approach.
Non-positive data are ignored (f(0) is infinite for wshape<1).
http://www.math.canterbury.ac.nz/~c.scarrott/evmix
http://en.wikipedia.org/wiki/Weibull_distribution
http://en.wikipedia.org/wiki/Generalized_Pareto_distribution
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
Hu, Y. (2013). Extreme value mixture modelling: An R package and simulation study. MSc (Hons) thesis, University of Canterbury, New Zealand. http://ir.canterbury.ac.nz/simple-search?query=extreme&submit=Go
Behrens, C.N., Lopes, H.F. and Gamerman, D. (2004). Bayesian analysis of extreme events with threshold estimation. Statistical Modelling. 4(3), 227-244.
Other weibullgpd: fitmweibullgpd,
fweibullgpdcon,
itmweibullgpd, weibullgpdcon,
weibullgpd
Other weibullgpdcon: fweibullgpdcon,
itmweibullgpd, weibullgpdcon,
weibullgpd
Other itmweibullgpd: fitmweibullgpd,
fweibullgpdcon,
itmweibullgpd, weibullgpdcon,
weibullgpd
Other fweibullgpd: weibullgpd
# NOT RUN {
set.seed(1)
par(mfrow = c(2, 1))
x = rweibull(1000, shape = 2)
xx = seq(-0.1, 4, 0.01)
y = dweibull(xx, shape = 2)
# Bulk model based tail fraction
fit = fweibullgpd(x)
hist(x, breaks = 100, freq = FALSE, xlim = c(-0.1, 4))
lines(xx, y)
with(fit, lines(xx, dweibullgpd(xx, wshape, wscale, u, sigmau, xi), col="red"))
abline(v = fit$u, col = "red")
# Parameterised tail fraction
fit2 = fweibullgpd(x, phiu = FALSE)
with(fit2, lines(xx, dweibullgpd(xx, wshape, wscale, u, sigmau, xi, phiu), col="blue"))
abline(v = fit2$u, col = "blue")
legend("topright", c("True Density","Bulk Tail Fraction","Parameterised Tail Fraction"),
col=c("black", "red", "blue"), lty = 1)
# Profile likelihood for initial value of threshold and fixed threshold approach
fitu = fweibullgpd(x, useq = seq(0.5, 2, length = 20))
fitfix = fweibullgpd(x, useq = seq(0.5, 2, length = 20), fixedu = TRUE)
hist(x, breaks = 100, freq = FALSE, xlim = c(-0.1, 4))
lines(xx, y)
with(fit, lines(xx, dweibullgpd(xx, wshape, wscale, u, sigmau, xi), col="red"))
abline(v = fit$u, col = "red")
with(fitu, lines(xx, dweibullgpd(xx, wshape, wscale, u, sigmau, xi), col="purple"))
abline(v = fitu$u, col = "purple")
with(fitfix, lines(xx, dweibullgpd(xx, wshape, wscale, u, sigmau, xi), col="darkgreen"))
abline(v = fitfix$u, col = "darkgreen")
legend("topright", c("True Density","Default initial value (90% quantile)",
"Prof. lik. for initial value", "Prof. lik. for fixed threshold"),
col=c("black", "red", "purple", "darkgreen"), lty = 1)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab