Skip to contents

truncated_distribution() conditions a severity on lower < X <= upper, as aggregate's sev_lb and sev_ub: its distribution function is (F(x) - F(lower)) / (F(upper) - F(lower)) on the window. Layer moments are exact, from the inner severity's. Properties: d@lower, d@upper, d@probability (of the window under the inner severity), d@family (the inner severity's).

Usage

truncated_distribution(severity, lower = 0, upper = Inf, ptr = NULL)

splice_distribution(weights, components, breaks)

Arguments

severity

Any severity but a sampled distribution.

lower, upper

The window, 0 <= lower < upper <= Inf.

ptr

Internal: an existing object to wrap.

weights

Positive weights summing to 1.

components

A list of severities, one per piece.

breaks

One more than the components: 0, the joins, and the top (which may be Inf).

Value

A truncated_distribution or a mixture_distribution, which inherit from distribution.

Details

splice_distribution() is a mixture_distribution of such pieces: component i conditioned on (breaks[i], breaks[i + 1]] with weight weights[i], such as a lognormal body and a Pareto tail.

Supports the same operations as pareto.

Examples

t <- truncated_distribution(lognormal_from_mean_cv(1000, 1), upper = 5000)
cdf(t, 5000)
#> [1] 1
s <- splice_distribution(c(0.9, 0.1),
  list(lognormal_from_mean_cv(50, 1), pareto(100, 1.8)), c(0, 100, Inf))
cdf(s, 100)
#> [1] 0.9