> This is a more general issue to be discussed how to structure > ProbabilityDistribution class. > Currently ProbabilityDistribution class (http://www.sagemath.org/doc/ > reference/sage/gsl/probability_distribution.html) includes the > following sub classes. > > RealDistribution: various real-valued probability distributions. > SphericalDistribution: uniformly distributed points on the surface > of an $n-1$ sphere in $n$ dimensional euclidean space. > GeneralDiscreteDistribution: user-defined discrete distributions. > > I feel this is a bit confusing. RealDistribution to the moment does > not include discrete distributions while GeneralDiscreteDistribution > only handles user defined discrete distributions. > > The term RealDistribution is confusing by itself. There is no unreal > distribution or something similar to that. Sage users probably would > use Wikipedia for reference and there is no such term in Wikipedia too
Perhaps 'continuous' would have been better, but that's how it is. +- Josh Kantor (2007-02): first version + +- William Stein (2007-02): rewrite of docs, conventions, etc. + +- Carlo Hamalainen (2008-08): full doctest coverage, more documentation, + GeneralDiscreteDistribution, misc fixes. + So as you can see, this dates to a very early time in Sage - just when the notebook was coming out, in fact. The refactoring in 2008 was very helpful. > I propose the following ways of structuring distribution classes in > Sage: > > 2. Alternatively, the base class ProbabilityDistribution, as it > exists now, will have two sub classes: (1) ContinuousDistribution and > (2) DiscreteDistribution, and both of them will implement user defined > probability functions too. I like this best - keep the mathematically distinct things separate, but subclass rather than make many separate classes. Unless you are going to implement general measures as well... However, for backward compatibility, we will need to keep RealDistribution etc. And I do not think this is all that confusing. More annoying is that all of this is in the gsl/ directory. The state of probability/ is a little confusing (needs major doctests, but it was hard to figure out exactly what was intended sometimes). Really, these functions should live there, or at least have wrappers there. Note that discrete random variables are already there! And that probability_space is one of the methods on these random variables... A job to untangle, to be sure, but a very worthy one. > I hope my considerations will trigger some discussion about > restructuring the ProbabilityDistribution class. Alternatively one may > think of omitting this class at all as the functionality is > implemented in NumPy and R more or less available from Sage. No, this is bad (assuming someone like you is interested in working on it). One of the main goals of Sage is to be a one-stop shop for mathematics (in the same way that Mma, Maple, etc. are). So we want unified syntax, and an easy way to get things. What good is it if something is in R if it's easier just to use straight R for it? So I encourage you to keep it up! - kcrisman -- 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
