{- |
Collection of some shapes of distribution.
-}moduleNumeric.Probability.Shapewhere{- |
A shape is a mapping from the interval @[0,1]@ to non-negative numbers.
They need not to be normalized (sum up to 1)
because this is done by subsequent steps.
(It would also be impossible to normalize the function in a way
that each discretization is normalized as well.)
-}typeT prob =prob ->prob linear ::Fractionalprob =>T prob linear :: forall prob. Fractional prob => T prob
linear =forall a. a -> a
iduniform ::Fractionalprob =>T prob uniform :: forall prob. Fractional prob => T prob
uniform =forall a b. a -> b -> a
constprob
1negExp ::Floatingprob =>T prob negExp :: forall prob. Floating prob => T prob
negExp prob
x =forall prob. Floating prob => T prob
exp(-prob
x )normal ::Floatingprob =>T prob normal :: forall prob. Floating prob => T prob
normal =forall prob. Floating prob => prob -> prob -> prob -> prob
normalCurve prob
0.5prob
0.5normalCurve ::Floatingprob =>prob ->prob ->prob ->prob normalCurve :: forall prob. Floating prob => prob -> prob -> prob -> prob
normalCurve prob
mean prob
dev prob
x =letu :: prob
u =(prob
x forall a. Num a => a -> a -> a
-prob
mean )forall a. Fractional a => a -> a -> a
/prob
dev inforall prob. Floating prob => T prob
exp(-prob
1forall a. Fractional a => a -> a -> a
/prob
2forall a. Num a => a -> a -> a
*prob
u forall a b. (Num a, Integral b) => a -> b -> a
^(Int
2::Int))forall a. Fractional a => a -> a -> a
/forall prob. Floating prob => T prob
sqrt(prob
2forall a. Num a => a -> a -> a
*forall a. Floating a => a
pi)

AltStyle によって変換されたページ (->オリジナル) /