nag_estim_gen_pareto (g07bfc) (PDF version)
g07 Chapter Contents
g07 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_estim_gen_pareto (g07bfc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_estim_gen_pareto (g07bfc) estimates parameter values for the generalized Pareto distribution by using either moments or maximum likelihood.

2  Specification

#include <nag.h>
#include <nagg07.h>
void  nag_estim_gen_pareto (Integer n, const double y[], Nag_OptimOpt optopt, double *xi, double *beta, double asvc[], double obsvc[], double *ll, NagError *fail)

3  Description

Let the distribution function of a set of n observations
yi ,   i=1,2,,n
be given by the generalized Pareto distribution:
Fy = 1- 1+ ξy β -1/ξ , ξ0 1-e-yβ , ξ=0;
where
Estimates ξ^ and β^ of the parameters ξ and β are calculated by using one of:
The variances and covariance of the asymptotic Normal distribution of parameter estimates ξ^ and β^ are returned if ξ^ satisfies:
If the MLE option is exercised, the observed variances and covariance of ξ^ and β^ is returned, given by the negative inverse Hessian of L.

4  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

5  Arguments

1:     nIntegerInput
On entry: the number of observations.
Constraint: n>1.
2:     y[n]const doubleInput
On entry: the n observations yi, for i=1,2,,n, assumed to follow a generalized Pareto distribution.
Constraints:
  • y[i-1]0.0;
  • i=1 n y[i-1]>0.0.
3:     optoptNag_OptimOptInput
On entry: determines the method of estimation, set:
optopt=Nag_PWM
For the method of probability-weighted moments.
optopt=Nag_MOM
For the method of moments.
optopt=Nag_MOMMLE
For maximum likelihood with starting values given by the method of moments estimates.
optopt=Nag_PWMMLE
For maximum likelihood with starting values given by the method of probability-weighted moments.
Constraint: optopt=Nag_PWM, Nag_MOM, Nag_MOMMLE or Nag_PWMMLE.
4:     xidouble *Output
On exit: the parameter estimate ξ^.
5:     betadouble *Output
On exit: the parameter estimate β^.
6:     asvc[4]doubleOutput
On exit: the variance-covariance of the asymptotic Normal distribution of ξ^ and β^. asvc[0] contains the variance of ξ^; asvc[3] contains the variance of β^; asvc[1] and asvc[2] contain the covariance of ξ^ and β^.
7:     obsvc[4]doubleOutput
On exit: if maximum likelihood estimates are requested, the observed variance-covariance of ξ^ and β^. obsvc[0] contains the variance of ξ^; obsvc[3] contains the variance of β^; obsvc[1] and obsvc[2] contain the covariance of ξ^ and β^.
8:     lldouble *Output
On exit: if maximum likelihood estimates are requested, ll contains the log-likelihood value L at the end of the optimization; otherwise ll is set to -1.0.
9:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, n=value.
Constraint: n>1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_OPTIMIZE
The maximum likelihood optimization failed; try a different starting point by selecting the other maximum likelihood estimation option in argument optopt.
Variance of data in y is too low for method of moments optimization.
NE_REAL_ARRAY
On entry, at least one y[i-1]0.0: i=value, y[i-1]=value.
NE_ZERO_SUM
The sum of y is zero within machine precision.
NW_PARAM_DIST
The distribution of maximum likelihood estimates cannot be calculated and the asymptotic distribution is not available for the returned parameter estimates.
NW_PARAM_DIST_ASYM
The asymptotic distribution is not available for the returned parameter estimates.
NW_PARAM_DIST_OBS
The distribution of maximum likelihood estimates cannot be calculated for the returned parameter estimates because the Hessian matrix could not be inverted.

7  Accuracy

Not applicable.

8  Further Comments

The search for maximum likelihood parameter estimates is further restricted by requiring
1+ ξ^yi β^ > 0 ,
as this avoids the possibility of making the log-likelihood L arbitrarily high.

9  Example

This example calculates parameter estimates for 23 observations assumed to be drawn from a generalized Pareto distribution.

9.1  Program Text

Program Text (g07bfce.c)

9.2  Program Data

Program Data (g07bfce.d)

9.3  Program Results

Program Results (g07bfce.r)


nag_estim_gen_pareto (g07bfc) (PDF version)
g07 Chapter Contents
g07 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012