Skip to contents

Uses discrete summation, justified because the probability-mass series of a proper discrete distribution converges to 1. Before truncating an unbounded support (e.g. Poisson), the tail mass is confirmed to fall below tol, demonstrating the series has a finite limit.

Usage

morie_dist_sum(dist, moment_order = 0L, center = 0, tol = 1e-10)

Arguments

dist

A discrete morie_distribution.

moment_order

If > 0, sum (k - center)^order * P(k) instead of the mass.

center

Centering value for central moments.

tol

Tail-mass tolerance for truncation.

Value

The summed value (total mass, or the requested moment).

Examples

morie_dist_sum(morie_distribution("poisson", lambda = 3))
#> [1] 1