[Haskell-cafe] Uncertainty analysis library?
Henning Thielemann
lemming at henning-thielemann.de
Mon Mar 21 23:24:30 CET 2011
On Mon, 21 Mar 2011, Tom Nielsen wrote:
> sampler = do
> x <- gauss 0.0 1.0
> y <- gauss 0.0 1.0
> return $ (2*x, x+y)
>
> main = do
> xys <- take 100000 `fmap` runSamplerIO sampler
> print $ runStat
> (both (before varF fst) (before varF snd)) $
> xys
>
> => (3.9988971177326498,2.0112123117664975)
> that is, (variance of 2*x, variance of x+y)
Variances of independent random variables (here x and y) are additive, for
dependent variables (say, x and x) this does not hold.
More information about the Haskell-Cafe
mailing list