> Jason Grout wrote:
>> Jason Grout wrote:
>>> Carlo Hamalainen wrote:
>>>> On Thu, Sep 17, 2009 at 6:48 AM, Robert Dodier
>>>> <robert.dod...@gmail.com> wrote:
>>>>> Some random comments on
>>>>> http://trac.sagemath.org/sage_trac/attachment/ticket/6827/probability_distribution.patch
>>>> Between that and the better performance of scipy (see my other email
>>>> in this thread) I figure we should probably throw away
>>>> probability_distribution.pyx and use the scipy stuff, at least for
>>>> generating gaussians and so on.
>>>>
>>>> What do other people think?
>>>>
>>
>> In this case, since you are deciding between wrapping GSL or wrapping
>> scipy or R, I think it would make a lot more sense to wrap R, given that
>> the speed of rpy2 and your implementation above are about the same.  We
>> can special-case things like William's code or the scipy code to make
>> things faster.  But for now, if we are trying to get a base of
>> functionality, it seems like wrapping R is the best way to go.
>> Everything else is a subset of the functionality in R.
>>
>>
>
>
> I played around with mathematica a bit today, and changed my mind.  I
> think it would be very, very cool to have symbolic statistics in Sage,
> with the actual numeric generation/calculation wrapping R, scipy, or
> custom code.  This would mean that we should keep developing our own
> probability code, but make it generic enough that people could pass in
> symbolic parameters as well as numbers.
>
> In Mathematica:
>
> In[2]:= ud=UniformDistribution[{a,b}]
>
> Out[2]= UniformDistribution[{a, b}]
>
> In[3]:= Mean[ud]
>
>          a + b
> Out[3]= -----
>            2
>
> In[4]:= StandardDeviation[ud]
>
>           -a + b
> Out[4]= ---------
>          2 Sqrt[3]
>
> In[11]:= ud/.{a->0,b->100}
>
> Out[11]= UniformDistribution[{0, 100}]
>
> In[12]:= RandomReal[ud/.{a->0,b->100}]
>
> Out[12]= 31.5712
>
> Hehe...we could have probability distributions that took random
> variables as input, like a uniform distribution where the endpoints were
> normal random variables, or the endpoints were interval arithmetic
> objects.  I'm not sure if that makes sense, but it seems like it would
> be very cool be flexible like that.

I think it makes a lot of sense; me and Robert Dodier already discussed
such things on this list. Basically, you could construct symbolic random
variables, set Bayesian priors etc., and then simulate from the resulting
distributions using the best approach based on a combination of symbolics
and numerics (e.g. MCMC). See

http://groups.google.com/group/sage-devel/browse_thread/thread/fda13f5129268bf2/179c4934e40bf5d0?q=sage-devel+bayesian#179c4934e40bf5d0


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
-~----------~----~----~----~------~----~------~--~---

Reply via email to