GenPareto_ML_Estimator_Alpha: Maximum Likelihood Estimation of the Pareto Alphas of a...

View source: R/Functions.R

GenPareto_ML_Estimator_AlphaR Documentation

Maximum Likelihood Estimation of the Pareto Alphas of a Generalized Pareto Distribution

Description

Calculates the maximum likelihood estimators of the parameters alpha_ini and alpha_tail of a generalized Pareto distribution with known threshold and (if applicable) known truncation

Usage

GenPareto_ML_Estimator_Alpha(
  losses,
  t,
  truncation = NULL,
  reporting_thresholds = NULL,
  is.censored = NULL,
  weights = NULL,
  alpha_min = 0.001,
  alpha_max = 10
)

Arguments

losses

Numeric vector. Losses that are used for the ML estimation.

t

Numeric or numeric vector. Threshold of the generalized Pareto distribution. Alternatively, t can be a vector of same length as losses. In this case t[i] is the reporting threshold of losses[i].

truncation

Numeric. If truncation is not NULL and truncation > t, then the generalized Pareto distribution is truncated at truncation.

reporting_thresholds

Numeric vector. Allows to enter loss specific reporting thresholds. If NULL then all reporting thresholds are assumed to be less than or equal to t.

is.censored

Logical vector. TRUE indicates that a loss has been censored by the policy limit. The assumption is that the uncensored losses are Generalized Pareto distributed with the alphas we are looking for. is.censored = NULL means that no losses are censored.

weights

Numeric vector. Weights for the losses. For instance weights[i] = 2 and weights[j] = 1 for j != i has the same effect as adding another loss of size loss[i].

alpha_min

Numeric. Lower bound for the estimated alphas.

alpha_max

Numeric. Upper bound for the estimated alphas.

Value

Maximum likelihood estimator for the parameters alpha_ini and alpha_tail of a generalized Pareto distribution with threshold t given the observations losses

Examples

losses <- rGenPareto(1000, 1000, 2,3)
GenPareto_ML_Estimator_Alpha(losses, 1000)
losses <- rGenPareto(1000, 1000, 2, 1, truncation = 10000)
GenPareto_ML_Estimator_Alpha(losses, 1000)
GenPareto_ML_Estimator_Alpha(losses, 1000, truncation = 10000)

t <- 1000
alpha_ini <- 1
alpha_tail <- 3
losses <- rGenPareto(5000, t, alpha_ini, alpha_tail)
reporting_thresholds <- rPareto(5000, 1000, 3)
reported <- losses > reporting_thresholds
losses <- losses[reported]
reporting_thresholds <- reporting_thresholds[reported]
GenPareto_ML_Estimator_Alpha(losses, t)
GenPareto_ML_Estimator_Alpha(losses, t, reporting_thresholds = reporting_thresholds)
limit <- 3000
censored <- losses > limit
losses[censored] <- limit
reported <- losses > reporting_thresholds
losses <- losses[reported]
censored <- censored[reported]
reporting_thresholds <- reporting_thresholds[reported]
GenPareto_ML_Estimator_Alpha(losses, t, reporting_thresholds = reporting_thresholds)
GenPareto_ML_Estimator_Alpha(losses, t, reporting_thresholds = reporting_thresholds,
                             is.censored = censored)

losses <- c(190, 600, 120, 270, 180, 120)
w <- rep(1, length(losses))
w[1] <- 3
losses2 <- c(losses, losses[1], losses[1])
GenPareto_ML_Estimator_Alpha(losses, 100, weights = w)
GenPareto_ML_Estimator_Alpha(losses2, 100)

Pareto documentation built on April 18, 2023, 9:10 a.m.