{- |
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 =iduniform::Fractionalprob =>T prob uniform =const1negExp::Floatingprob =>T prob negExp x =exp(-x )normal::Floatingprob =>T prob normal =normalCurve 0.50.5normalCurve::Floatingprob =>prob ->prob ->prob ->prob normalCurve mean dev x =letu =(x -mean )/dev inexp(-1/2*u ^(2::Int))/sqrt(2*pi)

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