Given a sample \(x\), Estimate the parameters \(k\) and \(\sigma\) of the generalized Pareto distribution (GPD), assuming the location parameter is 0. By default the fit uses a prior for \(k\) (this is in addition to the prior described by Zhang and Stephens, 2009), which will stabilize estimates for very small sample sizes (and low effective sample sizes in the case of MCMC samples). The weakly informative prior is a Gaussian prior centered at 0.5 (see details in Vehtari et al., 2024). This is used internally but is exported for use by other packages.
Arguments
- x
A numeric vector. The sample from which to estimate the parameters.
- wip
Logical indicating whether to adjust \(k\) based on a weakly informative Gaussian prior centered on 0.5. Defaults to
TRUE.- min_grid_pts
The minimum number of grid points used in the fitting algorithm. The actual number used is
min_grid_pts + floor(sqrt(length(x))).- sort_x
If
TRUE(the default), the first step in the fitting algorithm is to sort the elements ofx. Ifxis already sorted in ascending order thensort_xcan be set toFALSEto skip the initial sorting step.- weights
An optional numeric vector of positive weights the same length as
x. IfNULL(the default), all observations are weighted equally and the result is identical to the unweighted fit. Weights are normalized internally to sum tolength(x).
References
Zhang, J., and Stephens, M. A. (2009). A new and efficient estimation method for the generalized Pareto distribution. Technometrics 51, 316-325.
See also
Other helper-functions:
ps_convergence_rate(),
ps_khat_threshold(),
ps_min_ss(),
ps_tail_length()