The GPD is fitted to the exceedances of the threshold u
using
maximum likelihood estimation. The estimated parameters,
variance-covariance matrix and their standard errors are automatically
output.
The log-likelihood and negative log-likelihood are also provided for wider
usage, e.g. constructing your own extreme value mixture model or profile
likelihood functions. The
parameter vector pvector
must be specified in the negative
log-likelihood nlgpd
.
Log-likelihood calculations are carried out in
lgpd
, which takes parameters as inputs in the
same form as distribution functions. The negative log-likelihood is a
wrapper for lgpd
, designed towards making it
useable for optimisation (e.g. parameters are given a vector as first
input).
The default value for the tail fraction phiu
in the fitting function
fgpd
is NULL
, in which case the MLE is calculated
using the sample proportion of exceedances. In this case the standard error for phiu
is
estimated and output as se.phiu
, otherwise it is set to NA
. Consistent with the
evd
library the missing values (NA
and
NaN
) are assumed to be below the threshold in calculating the tail fraction.
Otherwise, in the fitting function fgpd
the tail
fraction phiu
can be specified as any value over \((0, 1]\), i.e.
excludes \(\phi_u=0\), leading to the unconditional log-likelihood being
used for estimation. In this case the standard error will be output as NA
.
In the log-likelihood functions lgpd
and
nlgpd
the tail fraction phiu
cannot be
NULL
but can be over the range \([0, 1]\), i.e. which includes
\(\phi_u=0\).
The value of phiu
does not effect the GPD parameter estimates, only
the value of the likelihood, as:
$$L(\sigma_u, \xi; u, \phi_u) = (\phi_u ^ {n_u}) L(\sigma_u, \xi; u,
\phi_u=1)$$
where the GPD has scale \(\sigma_u\) and shape \(\xi\), the threshold
is \(u\) and \(nu\) is the number of exceedances. A non-unit value for
phiu
simply scales the likelihood and shifts the log-likelihood,
thus the GPD parameter estimates are invariant to phiu
.
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
.