Open neongreen opened 11 years ago
I don't think there's any particular reason for it; I just haven't had the need so it didn't occur to me. I don't know how much time I have to dig into this at the moment, but if you have a patch I'd be happy to apply it.
Sure! Just thought there could be something about it that I didn’t understand. I’ll submit a pull request in a day or two.
However, I wasn’t able to write a generic CDF instance for a tuple. Is it possible to do without having something like prob :: Distribution d t => d t -> t -> Double
, which would return the probability of a given element being selected? If no, should I try and add a Probability
typeclass?
I don't think a meaningful one is really possible under the current definition of the CDF interface since it is explicitly not a joint CDF. I don't think I'd worry too much about that. And I'm not exactly against introducing a Probability concept, but I think it's hard to define in a way that applies equally well to discrete, continuous and multidimensional variables. Statistical calculations of that nature are also already pretty well-handled by the statistics package, which I think complements this one pretty nicely.
What is the rationale behind not including a simple instance for tuples?
Among other reasons, it is useful when the need to generate more than one random variable arises: