Skip to contents

Named grid_distribution so it does not mask graphics::grid().

Usage

grid_distribution(step, probs, ptr = NULL)

Arguments

step

Grid step; finite and positive.

probs

Non-negative probabilities summing to 1.

Value

A grid_distribution object, which inherits from distribution. Its report property is NULL for a grid built from probabilities, or a list with method, step, points, tail_mass, source_mean, grid_mean and mean_error.

Details

Probabilities probs at 0, step, 2 * step, ...: the discretized representation that Panjer and FFT aggregation work on. Usually made with discretize(), which also records how much error the grid introduced in g@report.

Supports mean(), variance(), quantile(), cdf(), lev(), stop_loss() and layer(), all exact on the grid.

Examples

g <- grid_distribution(1, c(0.5, 0.25, 0.25))
mean(g)
#> [1] 0.75
cdf(g, 1)
#> [1] 0.75