Jason Grout wrote: > Carlo Hamalainen wrote: >> On Wed, Sep 16, 2009 at 7:46 PM, Jason Grout >> <jason-s...@creativetrax.com> wrote: >>> R has a C interface for lots of functions (like the distribution >>> functions that I wanted today). I imagine that a stats module would use >>> Cython to call the C functions for these sorts of things, but then use >>> rpy2 for the rest of the interaction with R. >> Which distribution functions did you want? Are these of any use? >> http://trac.sagemath.org/sage_trac/ticket/6827 > > Wow, nice! > > I needed normal, binomial, and uniform distributions. > > It seems a little awkward to get these. For example: > > T = RealDistribution('uniform', [0, 2]) > > I guess it would be nice if there were convenience functions, so > > sage.probability.uniform([0,2]) > > constructed this.
I already regularily use two APIs for probability distributions: R and SciPy. Both do essentially the same thing (quantiles, integrals, densities, and random variates -- all numerical). I can understand that the R API perhaps isn't elegant enough to import into Sage as is, but perhaps the SciPy API could at least be emulated rather than creating a new API? http://docs.scipy.org/doc/scipy/reference/stats.html http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.uniform.html (With regards to creating Cython wrappers directly to C functions, I'd rather use the SciPy functionality, which is essentially the same thing, only that no reimplementation of the wheel is needed.) -- Dag Sverre --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---