Skip to contents

"local_moment" matches the mean on every cell (the grid mean is the limited mean up to the last point); "rounding" moves each loss to the nearest point; "lower" moves each cell's mass to its left end, a stochastic lower bound. Mass above the last point is lumped onto it and reported in g@report$tail_mass.

Usage

discretize(dist, step, points, method = c("local_moment", "rounding", "lower"))

Arguments

dist

A lognormal, a grid_distribution or a Pareto-family severity.

step

Grid step.

points

Number of grid points.

method

One of "local_moment", "rounding", "lower".

Value

A grid_distribution whose report property describes the error introduced.

Examples

g <- discretize(lognormal(7, 0.5), step = 100, points = 200)
g@report$tail_mass
#> [1] 3.37659e-09
mean(g)
#> [1] 1242.648