Module

Data.Distribution

Package
purescript-distributions
Repository
paf31/purescript-distributions

This module defines a monad of distributions, which generalizes the probability monad to an arbitrary Semiring.

#Dist Source

data Dist p a

A distribution of values of type a, with "probabilities" in some Semiring p.

Constructors

Instances

#dist Source

dist :: forall a p. List (Tuple p a) -> Dist p a

Create a distribution from a list of values and probabilities.

#observe Source

observe :: forall a p. Semiring p => Ord a => Dist p a -> List (Tuple p a)

Unpack the observations in a distribution, combining any probabilities for duplicate observations.