JuliaCon 2020 (times are in UTC)

Extending Distributions with Expectations.jl

Many statistical problems involve taking expectations of (some function of) a random variable. Expectations.jl defines fast and reusable operators that are highly accurate. Univariate mixture models are also supported. We explain the math (Gaussian quadrature) and design, and demonstrate their use.


Traditional ways to compute arbitrary expectations are Monte Carlo methods (expensive, and perhaps inaccurate) or "roll-your-own" numerical integration (tricky to implement.)

In Expectations.jl (https://github.com/QuantEcon/Expectations.jl), we export callable operators around Distributions.jl objects, defined by compact vectors of adaptive Gaussian quadrature nodes and weights. The operators adhere to mathematical properties (e.g. scalar multiplication), improving clarity.