haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] ANN: random-fu 0.1.0.0

Subject: Re: [Haskell-cafe] ANN: random-fu 0.1.0.0
From: Alexander Solla
Date: Thu, 3 Jun 2010 16:59:50 -0700

On Jun 3, 2010, at 4:19 PM, mokus@xxxxxxxxxxxxx wrote:

I don't think I understand.  My familiarity with probability theory is
fairly light. Are you referring to the fact that the PDF of the sum of
random variables is the convolution of their PDFs?  If so, the sum of
random variables can already be computed as "liftA2 (+) :: Num a => RVar a -> RVar a -> RVar a" since RVar is an applicative functor (or using liftM2
since it's also a monad).

Or perhaps you mean an operator that would take, say, 2 values of the
'Uniform' data type and return an instance of the 'Triangular' type
corresponding to the convolution of the distributions?

I think I had something like the former in mind. I didn't realize liftA2/M2 would do it. When I did this last, I just wrote a monadic action to sample values from different RVars. I should learn the higher order monad functions.

On the other hand, it might be kind of nice if RVar's knew which PDF they are over. It's hard for me to see how that would be done with Haskell.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>