gPdtest (version 0.4)

gpd.fit: Fitting the generalized Pareto distribution to data

Description

This function fits a generalized Pareto distribution (gPd) to a data set using either the asymptotic maximum likelihood method (amle) or the combined method proposed by Villasenor-Alva and Gonzalez-Estrada (2009).

Usage

gpd.fit(x,method)

Arguments

x
numeric data vector containing a random sample from a distribution function with support on the positive real numbers.
method
a character string giving the name of the parameter estimation method to be used. There are two available methods: "combined" and "amle". Use "combined" for fitting a gPd with shape parameter <0. use="" "amle" for fitting a gPd with shape parameter >= 0.

Value

The parameter estimates.

Details

The distribution function of the gPd is given in the details section of the function gpd.test.

References

Villasenor-Alva, J.A. and Gonzalez-Estrada, E. (2009). A bootstrap goodness of fit test for the generalized Pareto distribution. Computational Statistics and Data Analysis,53,11,3835-3841.

See Also

gpd.test for testing the gPd hypothesis, rgp for generating gPd random numbers.

Examples

Run this code
x <-  rgp(20,shape = 1)   	## Random sample of size 20
gpd.fit(x,"amle")           ## Fitting a gPd to  x  using the "amle" method

Run the code above in your browser using DataLab