Skip to contents

Claim counts beyond the Poisson, negative binomial and binomial, as in aggregate's zm, zt, logarithmic, mixed, neymana and dfreq:

Usage

claim_count_dist(ptr)

zero_modified_count(base, p0)

zero_truncated_count(base)

logarithmic_count(p)

mixed_poisson_count(
  mean,
  cv,
  mixing = c("gamma", "inverse_gaussian", "beta", "sichel", "sichel_gamma", "sichel_ig"),
  shift = 0,
  max = NULL,
  shape = NULL,
  skewness = NULL,
  f = NULL
)

gig_parameters(x)

compound_poisson_count(rate, secondary)

empirical_count(probs)

renewal_count(wait, horizon, step = NULL, points = NULL, closed = FALSE)

fixed_count(n)

bernoulli_count(p)

geometric_count(mean)

Arguments

ptr

Internal.

base, secondary

A claim count.

p0

P(N = 0), in [0, 1).

p

The logarithmic parameter, in (0, 1), or the Bernoulli probability, in [0, 1).

mean, cv, shift

See above.

mixing

"gamma", "inverse_gaussian", "beta", "sichel", "sichel_gamma" or "sichel_ig".

max

The beta mixing's largest Poisson mean, above mean * (1 + cv^2).

shape, skewness

The Sichel shape, or the skewness that sets it.

f

The fixed part matched by "sichel_gamma" and "sichel_ig".

x

A claim count.

rate

The Poisson rate of clusters.

probs

Probabilities of 0, 1, ..., summing to 1.

wait

A distribution, or list(values, probs).

horizon

The period, in the wait's units.

step, points

The wait grid; NULL for aggregate's.

closed

Whether waits summing to horizon count in full.

n

The fixed number of claims.

Value

A claim_count_dist, which inherits from distribution: use it with pmf(), cdf(), mean(), variance(), quantile() and draws().

Details

  • zero_modified_count(): base with P(N = 0) = p0; zero_truncated_count() is p0 = 0.

  • logarithmic_count(): P(N = k) = -p^k / (k log(1 - p)) on 1, 2, ....

  • mixed_poisson_count(): Poisson with mean mean * theta, where theta = shift + (1 - shift) G has mean 1 and coefficient of variation cv, and G is gamma (negative binomial, or Delaporte with a shift) or inverse Gaussian (Poisson-inverse Gaussian, or its shifted version). Variance mean + mean^2 cv^2. With no shift, as aggregate's, G may also be "beta", the Poisson mean max times a beta variable (mixed beta cv max), "sichel", the generalized inverse Gaussian with the given shape (mixed sichel cv shape; -0.5 is the inverse Gaussian) or, with skewness instead, the shape that gives it, or "sichel_gamma" and "sichel_ig", the generalized inverse Gaussian with the skewness of the Delaporte's or the shifted inverse Gaussian's mixing with fixed part f (mixed sichel.gamma cv f, mixed sichel.ig cv f). gig_parameters() gives the generalized inverse Gaussian a Sichel mixing solved, c(shape, omega, eta) (aggregate's lam, mu / beta and mu), or NULL.

  • compound_poisson_count(): a Poisson(rate) number of clusters of secondary claims (Poisson secondaries give the Neyman type A).

  • empirical_count(): P(N = k) = probs[k + 1].

  • renewal_count(): the number of claims by horizon when the waits between claims are independent draws from wait (a renewal, or Sparre Andersen, count; aggregate's years ... wait ...). Exponential waits give the Poisson. The wait is a distribution, or list(values, probs) of waits and their probabilities, which may sum to less than 1 (the process then ends). Waits of zero arrive in clusters. The wait grid is aggregate's unless step and points are given; closed counts waits summing to exactly horizon in full.

  • fixed_count(): N = n; bernoulli_count(): one claim with probability p in [0, 1); geometric_count(): P(N = k) = q (1 - q)^k on 0, 1, ... with q = 1 / (1 + mean), a negative binomial with shape 1 (aggregate's fixed, bernoulli and geometric).

Every aggregation function takes them. Zero-modified and logarithmic counts work with Panjer's recursion; the others need method = "fft".

Examples

zt <- zero_truncated_count(poisson_count(2))
pmf(zt, 0:3)
#> [1] 0.0000000 0.3130353 0.3130353 0.2086902
pig <- mixed_poisson_count(10, 0.5, mixing = "inverse_gaussian")
variance(pig) # 10 + 100 * 0.25
#> [1] 35
compound_distribution(pig, grid_distribution(1, c(0.2, 0.5, 0.3)), 200, method = "fft")
#> <grid_distribution> step = 1, 200 points
pmf(renewal_count(gamma_distribution(2, 1), 5), 0) # the first wait beyond 5: 6 exp(-5)
#> [1] 0.04042768