naginterfaces.library.univar.estim_​genpareto

naginterfaces.library.univar.estim_genpareto(y, optopt)[source]

estim_genpareto estimates parameter values for the generalized Pareto distribution by using either moments or maximum likelihood.

For full information please refer to the NAG Library document for g07bf

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g07/g07bff.html

Parameters
yfloat, array-like, shape

The observations , for , assumed to follow a generalized Pareto distribution.

optoptint

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.

Returns
xifloat

The parameter estimate .

betafloat

The parameter estimate .

asvcfloat, ndarray, shape

The variance-covariance of the asymptotic Normal distribution of and . contains the variance of ; contains the variance of ; and contain the covariance of and .

obsvcfloat, ndarray, shape

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 .

llfloat

If maximum likelihood estimates are requested, contains the log-likelihood value at the end of the optimization; otherwise is set to .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: for all .

(errno )

On entry, .

Constraint: , , or .

(errno )

The optimization of log-likelihood failed to converge; no maximum likelihood estimates are returned. Try using the other maximum likelihood option by resetting . If this also fails, moments-based estimates can be returned by an appropriate setting of .

(errno )

Variance of data in is too low for method of moments optimization.

(errno )

The sum of is zero within machine precision.

Warns
NagAlgorithmicWarning
(errno )

The asymptotic distribution is not available for the returned parameter estimates.

(errno )

The distribution of maximum likelihood estimates cannot be calculated for the returned parameter estimates because the Hessian matrix could not be inverted.

(errno )

The asymptotic distribution of parameter estimates is invalid and the distribution of maximum likelihood estimates cannot be calculated for the returned parameter estimates because the Hessian matrix could not be inverted.

Notes

Let the distribution function of a set of observations

be given by the generalized Pareto distribution:

where

and

, when ;

, when .

Estimates and of the parameters and are calculated by using one of:

method of moments (MOM);

probability-weighted moments (PWM);

maximum likelihood estimates (MLE) that seek to maximize the log-likelihood:

The variances and covariance of the asymptotic Normal distribution of parameter estimates and are returned if satisfies:

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 .

References

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