gp.fit: Fitting the generalized Pareto distribution to data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fits a generalized Pareto distribution (gPd) to a random sample using either the asymptotic maximum likelihood method (amle) or the combined estimation method (Villasenor-Alva and Gonzalez-Estrada, 2009).

Usage

1
gp_fit(x, method)

Arguments

x

a numeric data vector containing a random sample of 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 negative shape parameter. Use "amle" for fitting a gPd with non-negative shape parameter.

Details

The distribution function of the gPd is provided in the details section of the gp_test function.

Value

Parameter estimates.

Author(s)

Elizabeth Gonzalez-Estrada, Jose A. Villasenor-Alva

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. http://dx.doi.org/10.1016/j.csda.2009.04.001

See Also

gp_test for testing the gPd hypothesis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Example 1: fitting a gPd to the excesses above the threshold 0.165 ppm of the ozone
# levels provided in the o3 data set.
data(o3)
o3levels <- o3$ozone_level - 0.165      # ozone levels minus the threshold 0.165 ppm 
gp_fit(o3levels, method = "combined")   # fitting the gPd using the "combined" method 

# Example 2: fitting a gPd to a simulated data set from the uniform distribution,
# which is a gPd with shape parameter = -1 and scale parameter = 1.
x <-  runif(100)       # simulating a uniform random sample 
gp_fit(x, "combined")  # fitting a gPd to  x  using the "combined" method

Example output

Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival
Loading required package: npsurv
Loading required package: lsei
      Parameter estimates
shape             -0.3145
scale              0.0183
      Parameter estimates
shape             -1.2966
scale              1.2920

goft documentation built on July 1, 2020, 5:56 p.m.

Related to gp.fit in goft...