Loading [MathJax]/jax/output/HTML-CSS/jax.js
probability-polynomial-1.0.0.1: Probability distributions via piecewise polynomials
CopyrightPredictable Network Solutions Ltd. 2020-2024
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.Measure.Discrete

Description

 
Synopsis

Type

data Discrete a Source #

A discrete, finite signed measure on the number line.

Instances

Instances details
Show a => Show (Discrete a) Source # 
Instance details

Defined in Numeric.Measure.Discrete

Methods

showsPrec :: Int -> Discrete a -> ShowS #

show :: Discrete a -> String #

showList :: [Discrete a] -> ShowS #

(Ord a, Num a) => Eq (Discrete a) Source #

Two measures are equal if they yield the same measures on every set.

mx == my
  implies
  forall t. eval (distribution mx) t = eval (distribution my) t
Instance details

Defined in Numeric.Measure.Discrete

Methods

(==) :: Discrete a -> Discrete a -> Bool #

(/=) :: Discrete a -> Discrete a -> Bool #

fromMap :: (Ord a, Num a) => Map a a -> Discrete a Source #

Construct a discrete measure from a collection of points and their measures.

toMap :: Num a => Discrete a -> Map a a Source #

Decompose the discrete measure into a collection of points and their measures.

zero :: Num a => Discrete a Source #

The measure that assigns 0 to every set.

dirac :: (Ord a, Num a) => a -> Discrete a Source #

A Dirac measure at the given point x.

total (dirac x) = 1

distribution :: (Ord a, Num a) => Discrete a -> Piecewise (Poly a) Source #

eval (distribution m) x is the measure of the interval (,x].

This is known as the distribution function.

Observations

total :: Num a => Discrete a -> a Source #

The total of the measure applied to the set of real numbers.

integrate :: (Ord a, Num a) => (a -> a) -> Discrete a -> a Source #

Integrate a function f with respect to the given measure m, f(x)dm(x).

Operations, numerical

add :: (Ord a, Num a) => Discrete a -> Discrete a -> Discrete a Source #

Add two measures.

total (add mx my) = total mx + total my

scale :: (Ord a, Num a) => a -> Discrete a -> Discrete a Source #

Scale a measure by a constant.

total (scale a mx) = a * total mx

translate :: (Ord a, Num a) => a -> Discrete a -> Discrete a Source #

Translate a measure along the number line.

eval (distribution (translate y m)) x
   = eval (distribution m) (x - y)

convolve :: (Ord a, Num a) => Discrete a -> Discrete a -> Discrete a Source #

Additive convolution of two measures.

Properties:

convolve (dirac x) (dirac y) = dirac (x + y)