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

2010-06-07 Thread wren ng thornton
James Andrew Cook wrote: In particular, functions such as 'uniform' and 'normal' which directly construct RVars are very useful in defining the rvar implementation of other types. I have been reluctant to drop the rvar function from the Distribution class because it is very useful to be able

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

2010-06-07 Thread James Andrew Cook
On Jun 4, 2010, at 9:42 PM, wren ng thornton wrote: ---unless, perhaps, you have a way of deriving a definition of rvarT from rvar. If so, then there could be efficiency issues in the other direction. I could see some people just giving a pretty implementation of rvar and using the

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

2010-06-04 Thread James Andrew Cook
On Jun 3, 2010, at 10:03 PM, wren ng thornton wrote: Though, since RVar is a synonym for RVarT, I can't imagine why rvar is a method instead of a shorthand defined outside of the class. (If RVar were primitive then I could imagine performance reasons, but since it isn't...) The reason for

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

2010-06-04 Thread James Andrew Cook
On Jun 4, 2010, at 1:19 AM, Alexander Solla wrote: We don't necessarily have to compute the inverse of the distribution via sampling to do it. It can be done algebraically, in terms of the convolution operator. Since the types are enumerated, wouldn't something like... work? -- A set

[Haskell-cafe] ANN: random-fu 0.1.0.0

2010-06-03 Thread mokus
Announcing the 0.1.0.0 release of the random-fu library for random number generation[1]. This release hopefully stabilizes the core interfaces (those exported from the base module Data.Random). Warning to anyone upgrading from earlier releases: 'Discrete' has been renamed 'Categorical', the

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

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 6:34 AM, mo...@deepbondi.net wrote: Announcing the 0.1.0.0 release of the random-fu library for random number generation[1]. This release hopefully stabilizes the core interfaces (those exported from the base module Data.Random). Great work, I'm upgrading now. The only

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

2010-06-03 Thread mokus
The only feature suggestion I can suggest is the addition of a convolution operator to combine distributions (reified as RVar's in this implementation, though of course the difference between a random variable over a distribution and the distribution is rather thin) I don't think I

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

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 4:19 PM, mo...@deepbondi.net 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

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

2010-06-03 Thread mokus
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. If anyone knows a way this could be done while still allowing general functions to be mapped over RVars, I'd love to hear about it. My suspicion

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

2010-06-03 Thread wren ng thornton
Richard O'Keefe wrote: There's something in that package that I don't understand, and I feel really stupid about this. data RVarT m a type RVar = RVarT Identity class Distribution d t where rvar :: d t - RVar t rvarT :: d t - RVarT n t Where does n come from? Presumably from

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

2010-06-03 Thread mokus
There's something in that package that I don't understand, and I feel really stupid about this. data RVarT m a type RVar = RVarT Identity class Distribution d t where rvar :: d t - RVar t rvarT :: d t - RVarT n t Where does n come from? There's no reason to feel stupid when

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

2010-06-03 Thread Alexander Solla
On Jun 3, 2010, at 6:40 PM, mo...@deepbondi.net wrote: If anyone knows a way this could be done while still allowing general functions to be mapped over RVars, I'd love to hear about it. My suspicion though is that it is not possible. It would be a very similar problem to computing the