Learn R Programming

heavytails (version 0.1.1)

gpd_lg_likelihood: Negative Log likelihood of Generalized Pareto Distribution

Description

Helper function for pot_estimator(). Returns the \(\xi\) and \(\beta\) that minimize the negative log-likelihood of the Generalized Pareto Distribution (GPD).

Usage

gpd_lg_likelihood(params, data)

Value

Negative log-likelihood of the GPD.

Arguments

params

Vector containing initial values of \(\xi\) and \(\beta\)

data

Original dataset

Details

$$l(\xi,\beta)=-n\log(\beta) - (\frac{1}{\xi} + 1)\sum_{i=1}^{n} \log(1 + \xi \frac{x_i}{\beta})$$

Examples

Run this code

x <- rweibull(n=2000, shape = 0.8, scale = 1)
u <- 2 # Threshold
y <- x[x > u] - u
log_lik <- gpd_lg_likelihood(params = c(xi = 0.1, beta = 2), data = y)


Run the code above in your browser using DataLab