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

Description Usage Arguments Value Examples

View source: R/Functions.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 March 3, 2021, 5:07 p.m.