For what it's worth, bear in mind that the distinction of continuous vs discrete distributions isn't mathematically fundamental; it's easy to come up with distributions which are neither continuous nor discrete. E.g. mixtures of discrete and continuous distributions, and distributions on "exotic" sets such as a Cantor set or other fractal.
When I put together a class hierarchy (in Java) for probability distributions some years ago, the fundamental type was for a conditional distribution, of which unconditional distribution was a subclass, and familiar types such as Gaussian, uniform, etc. were subclasses of the unconditional distribution type. There was a useful-but-not-exactly-fundamental category, expressed as an interface implemented by some distributions, namely the location & scale category (e.g. Gaussian). Whether a distribution is continuous or discrete is a property of its support, and it mostly mattered (in that Java project) because that determined the method of integrating wrt to the distribution: discrete => summation, continuous => ordinary integral. (It seems that sufficient cleverness could merge the two; you just need the machinery for a more general integral.) Aside from that, user defined vs built-in seems incidental; I guess I wouldn't recommend enshrining it in the type hierarchy. If the user wants to define a new distribution, they just create a new class, right? I suggest that as you try to roll in the symbolic stuff for each distribution; e.g. the function to compute the density returns a symbolic expression if it doesn't evaluate to a number. FTR the stuff I worked on in Java is called RISO. http://riso.sourceforge.net It is essentially a purpose-built quasi-symbolic system to compute integrals for Bayesian inference. FWIW & all the best. Robert Dodier -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
