Skip to contents

Estimate the alpha of a pareto, the alphas of a piecewise_pareto, or the initial and tail alphas of Riegel's generalized_pareto, from large losses, each conditioned on exceeding its reporting threshold (raised to the lowest threshold of the fit), with losses capped by a policy limit treated as censored. Untruncated Pareto estimates are closed forms; truncated ones are solved numerically and clamped to [0.001, 1000]. A piecewise Pareto truncated as a whole (truncation_type = "wd") couples the alphas, which are then solved together. The generalized Pareto fit is untruncated; read its alphas as t / g@beta and 1 / g@xi.

Usage

pareto_fit(
  losses,
  t,
  reporting_thresholds = NULL,
  censored = NULL,
  weights = NULL,
  truncation = NULL
)

piecewise_pareto_fit(
  losses,
  t,
  reporting_thresholds = NULL,
  censored = NULL,
  weights = NULL,
  truncation = NULL,
  truncation_type = "lp"
)

generalized_pareto_fit(
  losses,
  t,
  reporting_thresholds = NULL,
  censored = NULL,
  weights = NULL
)

Arguments

losses

Numeric vector of losses at or above t (t[1]).

t

Threshold (pareto_fit) or thresholds (piecewise_pareto_fit).

reporting_thresholds

Per-loss reporting thresholds, or NULL.

censored

Logical vector, TRUE where a loss was capped, or NULL.

weights

Per-loss weights, or NULL.

truncation

Truncation point, or NULL.

truncation_type

For piecewise_pareto_fit(): "lp" to truncate the last piece, "wd" the whole distribution.

Examples

pareto_fit(c(1500, 2500, 4000, 10000), 1000, censored = c(FALSE, FALSE, FALSE, TRUE))
#> <pareto> t = 1000, alpha = 0.598726473574065
piecewise_pareto_fit(c(1200, 1500, 2500, 6000), c(1000, 2000))
#> <piecewise_pareto> 2 pieces
#>      t    alpha
#> 1 1000 1.013130
#> 2 2000 1.513139
g <- generalized_pareto_fit(c(1100, 1300, 1750, 2600, 4100, 9000, 25000), 1000)
c(alpha_ini = 1000 / g@beta, alpha_tail = 1 / g@xi)
#>  alpha_ini alpha_tail 
#>  0.6625138  0.9576544