expectation.poisson_dist: Exact expectation for a Poisson distribution.

View source: R/poisson_dist.R

expectation.poisson_distR Documentation

Exact expectation for a Poisson distribution.

Description

Computes E[g(X)] using truncated summation over the support. The summation is truncated at the 1 - 10^{-12} quantile to ensure negligible truncation error.

Usage

## S3 method for class 'poisson_dist'
expectation(x, g, ...)

Arguments

x

A poisson_dist object.

g

A function to take the expectation of.

...

Additional arguments passed to g.

Value

The expected value E[g(X)].

Examples

x <- poisson_dist(5)
expectation(x, identity)
expectation(x, function(k) k^2)

algebraic.dist documentation built on Feb. 27, 2026, 5:06 p.m.