NAG Library Routine Document
G07BFF estimates parameter values for the generalized Pareto distribution by using either moments or maximum likelihood.
||N, OPTOPT, IFAIL
||Y(N), XI, BETA, ASVC(4), OBSVC(4), LL
Let the distribution function of a set of
be given by the generalized Pareto distribution:
- , when ;
- , when .
of the parameters
are calculated by using one of:
- method of moments (MOM);
- probability-weighted moments (PWM);
- maximum likelihood estimates (MLE) that seek to maximise the log-likelihood:
The variances and covariance of the asymptotic Normal distribution of parameter estimates
are returned if
- for the MOM;
- for the PWM method;
- for the MLE method.
If the MLE option is exercised, the observed variances and covariance of and is returned, given by the negative inverse Hessian of .
Hosking J R M and Wallis J R (1987) Parameter and quantile estimation for the generalized Pareto distribution Technometrics 29(3)
McNeil A J, Frey R and Embrechts P (2005) Quantitative Risk Management Princeton University Press
- 1: N – INTEGERInput
On entry: the number of observations.
- 2: Y(N) – REAL (KIND=nag_wp) arrayInput
On entry: the observations
, for , assumed to follow a generalized Pareto distribution.
- 3: OPTOPT – INTEGERInput
: determines the method of estimation, set:
- For the method of probability-weighted moments.
- For the method of moments.
- For maximum likelihood with starting values given by the method of moments estimates.
- For maximum likelihood with starting values given by the method of probability-weighted moments.
, , or .
- 4: XI – REAL (KIND=nag_wp)Output
On exit: the parameter estimate .
- 5: BETA – REAL (KIND=nag_wp)Output
On exit: the parameter estimate .
- 6: ASVC() – REAL (KIND=nag_wp) arrayOutput
On exit: the variance-covariance of the asymptotic Normal distribution of and . contains the variance of ; contains the variance of ; and contain the covariance of and .
- 7: OBSVC() – REAL (KIND=nag_wp) arrayOutput
On exit: if maximum likelihood estimates are requested, the observed variance-covariance of and . contains the variance of ; contains the variance of ; and contain the covariance of and .
- 8: LL – REAL (KIND=nag_wp)Output
: if maximum likelihood estimates are requested, LL
contains the log-likelihood value
at the end of the optimization; otherwise LL
is set to
- 9: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
At least one value of is less than zero.
must equal one of
The asymptotic distribution of parameter estimates is invalid.
The distribution of maximum likelihood estimate of parameters is not available because the Hessian of could not be inverted.
The asymptotic distribution of parameter estimates is invalid and the distribution of maximum likelihood estimate of parameters is not available because the Hessian of could not be inverted.
The optimization of log-likelihood failed to converge; no maximum likelihood estimates are returned. Try using the other maximum likelihood option by resetting OPTOPT
. If this also fails, moments-based estimates can be returned by an appropriate setting of OPTOPT
Variance of data in Y
is too low for method of moments optimization.
The sum of Y
is zero within machine precision
The search for maximum likelihood parameter estimates is further restricted by requiring
as this avoids the possibility of making the log-likelihood
This example calculates parameter estimates for observations assumed to be drawn from a generalized Pareto distribution.
9.1 Program Text
Program Text (g07bffe.f90)
9.2 Program Data
Program Data (g07bffe.d)
9.3 Program Results
Program Results (g07bffe.r)