Types classes for probability distrubutions
- class Distribution d where
- class Distribution d => DiscreteDistr d where
- class Distribution d => ContDistr d where
- class Distribution d => Mean d where
- class Mean d => Variance d where
- findRoot :: ContDistr d => d -> Double -> Double -> Double -> Double -> Double
- sumProbabilities :: DiscreteDistr d => d -> Int -> Int -> Double
Type class common to all distributions. Only c.d.f. could be defined for both discrete and continous distributions.
Cumulative distribution function. The probability that a random variable X is less or equal than x, i.e. P(X≤x).
Discrete probability distribution.
Continuous probability distributuion
Probability density function. Probability that random variable X lies in the infinitesimal interval [x,x+δx) equal to density(x)⋅δx
Inverse of the cumulative distribution function. The value x for which P(X≤x) = p.
Type class for distributions with mean.
Type class for distributions with variance.
|:: ContDistr d|
Lower bound on interval
Upper bound on interval
Approximate the value of X for which P(x>X)=p.
This method uses a combination of Newton-Raphson iteration and bisection with the given guess as a starting point. The upper and lower bounds specify the interval in which the probability distribution reaches the value p.