주요 콘텐츠

gplike

Generalized Pareto negative loglikelihood

Description

nlogL = gplike(params,x) returns the generalized Pareto (GP) negative loglikelihood of the distribution parameters (params) given the sample data (x). params(1) and params(2) correspond to the GP shape (k) and scale (sigma) parameters, respectively. gplike does not allow a threshold (location) parameter. If the threshold parameter is known to be nonzero, subtract it from x before calling gplike.

[nlogL,aVar] = gplike(params,x) also returns the inverse of the Fisher information matrix aVar. If the values in params are the maximum likelihood estimates (MLEs) of the parameters, the diagonal elements of aVar are their asymptotic variances. aVar is based on the observed Fisher information, not the expected information.

example

Examples

collapse all

Find the maximum likelihood estimates (MLEs) of a random data set drawn from the generalized Pareto distribution by using the mle function, and then find the negative loglikelihood of the MLEs by using the gplike function.

Generate 1000 random numbers from the generalized Pareto distribution with the parameters k=–0.2, sigma=2, and theta=0.

rng(0,"twister") % For reproducibility
n = 1000; % Number of samples
k = -0.2;
sigma = 2;
theta = 0;
x = gprnd(k,sigma,theta,[n,1]);

Find the MLEs for the k and sigma parameters.

pHat = mle(x,Distribution="Generalized Pareto",theta=theta)
pHat = 1×2

   -0.2404    2.0832

Compute the negative loglikelihood of the MLEs and the inverse of the Fisher information matrix.

[nlogL,aVar] = gplike(pHat,x)
nlogL = 
1.4935e+03
aVar = 2×2

    0.0004   -0.0012
   -0.0012    0.0058

Because pHat contains MLE values, the gplike function returns their asymptotic variances in the diagonal elements of aVar.

Input Arguments

collapse all

GP distribution parameters, specified as a vector of two numeric values. params(1) and params(2) are the shape and scale values, respectively. params(2) must be positive.

Data Types: single | double

Sample data, specified as a numeric vector.

Data Types: single | double

Output Arguments

collapse all

Negative loglikelihood value of the distribution parameters (params) given the sample data (x), returned as a numeric scalar.

Inverse of the Fisher information matrix, returned as a 2-by-2 numeric matrix. aVar is based on the observed Fisher information given the observed data (x), not the expected information.

If values in params are the MLEs of the parameters, aVar is an approximation to the asymptotic variance-covariance matrix (also known as the asymptotic covariance matrix). To find the MLEs, use mle.

Alternative Functionality

gplike is a function specific to the GP distribution. Statistics and Machine Learning Toolbox™ also offers the generic functions mlecov, fitdist, negloglik, and proflik and the Distribution Fitter app, which support various probability distributions.

  • mlecov returns the asymptotic covariance matrix of the MLEs of the parameters for a distribution specified by a custom probability density function. For example, mlecov(params,x,"pdf",@gppdf) returns the asymptotic covariance matrix of the MLEs for the GP distribution.

  • Create a GeneralizedParetoDistribution probability distribution object by fitting the distribution to data using the fitdist function or the Distribution Fitter app. The object property ParameterCovariance stores the covariance matrix of the parameter estimates. To obtain the negative loglikelihood of the parameter estimates and the profile of the likelihood function, pass the object to negloglik and proflik, respectively.

References

[1] Embrechts, P., C. Klüppelberg, and T. Mikosch. Modelling Extremal Events for Insurance and Finance. New York: Springer, 1997.

[2] Kotz, S., and S. Nadarajah. Extreme Value Distributions: Theory and Applications. London: Imperial College Press, 2000.

Extended Capabilities

expand all

Version History

Introduced before R2006a