Learn R Programming

evmix (version 1.0)

fhpdcon: MLE Fitting of Hybrid Pareto Extreme Value Mixture Model with Single Continuity Constraint

Description

Maximum likelihood estimation for fitting the hybrid Pareto extreme value mixture modelwith a single continuiuty constraint

Usage

fhpdcon(x, pvector = NULL, std.err = TRUE,
    method = "BFGS", control = list(maxit = 10000),
    finitelik = TRUE, ...)

Arguments

pvector
vector of initial values of mixture model parameters (nmean, nsd, u, xi) or NULL
x
vector of sample data
std.err
logical, should standard errors be calculated
method
optimisation method (see optim)
control
optimisation control list (see optim)
finitelik
logical, should log-likelihood return finite value for invalid parameters
...
optional inputs passed to optim

Value

  • Returns a simple list with the following elements ll{ call: optim call x: data vector x init: pvector optim: complete optim output mle: vector of MLE of model parameters cov: variance-covariance matrix of MLE of model parameters se: vector of standard errors of MLE of model parameters rate: phiu to be consistent with evd nllh: minimum negative log-likelihood allparams: vector of MLE of model parameters, including sigmau and phiu allse: vector of standard error of all parameters, includingsigmau and phiu n: total sample size nmean: MLE of normal mean nsd: MLE of normal standard deviation u: threshold sigmau: MLE of GPD scale xi: MLE of GPD shape } The output list has some duplicate entries and repeats some of the inputs to both provide similar items to those from fpot and to make it as useable as possible.

Details

The hybrid Pareto model is fitted to the entire dataset using maximum likelihood estimation. The estimated parameters, variance-covariance matrix and their standard errors are automatically output. Missing values (NA and NaN) are assumed to be invalid data so are ignored, which is inconsistent with the evd library which assumes the missing values are below the threshold. The default optimisation algorithm is "BFGS", which requires a finite negative log-likelihood function evaluation finitelik=TRUE. For invalid parameters, a zero likelihood is replaced with exp(-1e6). The "BFGS" optimisation algorithms require finite values for likelihood, so any user input for finitelik will be overridden and set to finitelik=TRUE if either of these optimisation methods is chosen. It will display a warning for non-zero convergence result comes from optim function call. If the hessian is of reduced rank then the variance covariance (from inverse hessian) and standard error of parameters cannot be calculated, then by default std.err=TRUE and the function will stop. If you want the parameter estimates even if the hessian is of reduced rank (e.g. in a simulation study) then set std.err=FALSE.

References

http://en.wikipedia.org/wiki/Normal_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 Carreau, J. and Y. Bengio (2008). A hybrid Pareto model for asymmetric fat-tailed data: the univariate case. Extremes 12 (1), 53-76.

See Also

lgpd and gpd The condmixt package written by one of the original authors of the hybrid Pareto model (Carreau and Bengio, 2008) also has similar functions for the likelihood of the hybrid Pareto hpareto.negloglike and fitting hpareto.fit. Other hpdcon: dhpdcon, hpdcon, lhpdcon, nlhpdcon, phpdcon, qhpdcon, rhpdcon

Examples

Run this code
par(mfrow=c(2,1))
x = rnorm(1000)
xx = seq(-4, 4, 0.01)
y = dnorm(xx)

# Hybrid Pareto provides reasonable fit for asymmetric heavy tailed distribution
# but not for cases such as the normal distribution
fitcon = fhpdcon(x, std.err = FALSE)
fit = fhpd(x, std.err = FALSE)
hist(x, breaks = 100, freq = FALSE, xlim = c(-4, 4))
lines(xx, y)
lines(xx, dhpdcon(xx, nmean = fitcon$nmean, nsd = fitcon$nsd, u = fitcon$u,
  xi = fitcon$xi), col="red")
abline(v = fit$u)
lines(xx, dhpd(xx, nmean = fit$nmean, nsd = fit$nsd, xi = fit$xi), col="green")

# Notice that if tail fraction is included a better fit is obtained
fit2 = fnormgpdcon(x, std.err = FALSE)
hist(x, breaks = 100, freq = FALSE, xlim = c(-4, 4))
lines(xx, y)
lines(xx, dnormgpdcon(xx, nmean = fit2$nmean, nsd = fit2$nsd, u = fit2$u,
  xi = fit2$xi), col="blue")
lines(xx, dhpdcon(xx, nmean = fitcon$nmean, nsd = fitcon$nsd, u = fitcon$u,
  xi = fitcon$xi), col="red")
abline(v = fit2$u)

Run the code above in your browser using DataLab