Skip to contents

Integrates integrand (default: the density, giving total mass 1) over the distribution's support. Stability conditions – the integrand must be finite and the density non-negative and integrable – are documented and pre-checked before stats::integrate() is called.

Usage

morie_dist_integrate(dist, integrand = NULL, lower = NULL, upper = NULL)

Arguments

dist

A morie_distribution (continuous).

integrand

Function of x to integrate (default the density).

lower, upper

Integration limits (default the distribution's effective support via extreme quantiles).

Value

A list with value and the numeric abs.error.

Examples

morie_dist_integrate(morie_distribution("normal", mean = 0, sd = 1))$value
#> [1] 1