Skip to contents

fft_bivariate() gives the joint annual loss (A, B) of two lines hit by one count of events: each event gives a pair of losses from the joint per-event severity (a matrix, rows for line A at 0, step_a, ..., columns for line B), and mass at 0 on a line is an event that misses it. The joint law is the compound FFT with two-dimensional transforms.

Usage

fft_bivariate(frequency, severity, steps = c(1, 1), points)

clash_model(only_a, only_b, both)

clash_severity(clash, a, b)

clash_aggregate(clash, frequency, a, b, points)

Arguments

frequency

The shared count of events: a poisson_count, negative_binomial_count, binomial_count or claim count.

severity

A matrix of probabilities summing to 1.

steps

The step on line A and on line B.

points

Points on each line of the result.

only_a, only_b

Expected events a year hitting one line only.

both

Expected events a year hitting both lines, positive.

clash

A clash_model().

a, b

grid_distributions: the loss to each line given that the event hits it.

Value

fft_bivariate(), clash_aggregate() and clash_severity(): a list with density (the joint probabilities as a matrix; mass past the last row or column is carried on it), steps, marginal_a, marginal_b and total (grid_distributions; the total is exact when the steps are equal, else on the larger step keeping the mean), means, variances, covariance, correlation, and, but for clash_severity(), report: tail_mass and aliasing_mass on each line (the mass that wrapped around the FFT buffer; request more points when it is not negligible), expected_means and grid_means. clash_model(): a list of class clash_model with the three counts, neither, events, trigger_a and trigger_b.

Details

clash_model() is the clash model of the Python package aggregate (clash): the expected events a year hitting line A only, line B only and both (the clash count). Independence within an event fixes those hitting neither, only_a * only_b / both, so there are events in all, each hitting A with probability trigger_a and B with trigger_b. The dependence between the lines comes only from the shared count: with a Poisson count Cov(A, B) = both * E[X] * E[Y]. clash_severity() is its per-event severity and clash_aggregate() its joint annual loss, with a count whose mean is events.

Examples

clash <- clash_model(only_a = 2, only_b = 3, both = 1)
clash$events
#> [1] 12
a <- grid_distribution(1, c(0, 0.5, 0.5))
b <- grid_distribution(1, c(0, 1))
joint <- clash_aggregate(clash, poisson_count(clash$events), a, b, points = c(128, 128))
joint$covariance # both * E[X] * E[Y] = 1.5
#> [1] 1.5
joint$correlation
#> [1] 0.2738613
mean(joint$total)
#> [1] 8.5