Re: [sympy] stats module

2014-09-29 Thread clemens novak
Hi, I opened issue #8140 for that on github (https://github.com/sympy/sympy/issues/8140). I was analyzing the issue further and wrote a corresponding comment. I'd suggest that we continue the discussion on GH... Regards - Clemens Am Sonntag, 28. September 2014 21:26:32 UTC+2 schrieb Aaron M

Re: [sympy] stats module

2014-09-28 Thread Aaron Meurer
In Python 3 the error is TypeError: unorderable types: complex() < int(). Aaron Meurer On Sun, Sep 28, 2014 at 2:21 PM, clemens novak wrote: > Hi, > > I investigated the topic a bit further. One problem seems to be that > sympy.plotting is not able to deal with piecewise functions. The code belo

Re: [sympy] stats module

2014-09-28 Thread clemens novak
Hi, I investigated the topic a bit further. One problem seems to be that sympy.plotting is not able to deal with piecewise functions. The code below throws an error (see message below) also when I use the latest git version: from sympy import * from sympy.plotting import * from sympy.stats impo

Re: [sympy] stats module

2014-09-25 Thread Aaron Meurer
This works for me, even in 0.7.5. I get a plot that looks like a step function. Aaron Meurer On Thu, Sep 25, 2014 at 6:04 AM, Matthew Rocklin wrote: > Yeah, wow, that expression and plot does look horrible. > > Looks like a bug to me. Generally integration on piecewise functions > probably isn'

Re: [sympy] stats module

2014-09-25 Thread Matthew Rocklin
Yeah, wow, that expression and plot does look horrible. Looks like a bug to me. Generally integration on piecewise functions probably isn't as pretty as integration on normal distributions. On Wed, Sep 24, 2014 at 8:29 AM, clemens novak wrote: > Hello, > > i'm using sympy 0.7.5. and ran into t

[sympy] stats module

2014-09-24 Thread clemens novak
Hello, i'm using sympy 0.7.5. and ran into the following issue when using the stats module. from sympy.stats import Uniform, density from sympy.abc import x, y, z from sympy import * from sympy.plotting import plot # I define two rv's with uniform distribution X = Uniform('X', -1., 1.) Y = Unif

Re: [sympy] Stats module problem

2014-01-31 Thread Aaron Meurer
It fails like that in master. AttributeError is pretty much always a bug (unless you yourself accessed an attribute that is not there, or passed in the wrong type to something). Aaron Meurer On Wed, Jan 29, 2014 at 12:56 PM, Matthew Rocklin wrote: > This doesn't fail in 0.7.3 (Access to master i

Re: [sympy] Stats module problem

2014-01-29 Thread Matthew Rocklin
This doesn't fail in 0.7.3 (Access to master isn't convenient at the moment). Even when it doesn't err it still doesn't produce anything meaningful. On Wed, Jan 29, 2014 at 10:06 AM, F. B. wrote: > > In [5]: X = ContinuousRV(x, x, (0, 2)) > > In [6]: Y = tan(X) > > In [7]: density(Y) > Attribu

[sympy] Stats module problem

2014-01-29 Thread F. B.
In [5]: X = ContinuousRV(x, x, (0, 2)) In [6]: Y = tan(X) In [7]: density(Y) AttributeError: 'tuple' object has no attribute 'is_Piecewise' Is this a bug or a missing feature? -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this

Re: [sympy] Stats module

2014-01-21 Thread F. B.
On Tuesday, January 21, 2014 6:37:09 PM UTC+1, Matthew wrote: > > == doesn't mean SymPy equality, it means Python equality. Try Eq(X, 3) > instead. > Oh, you're right. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group

Re: [sympy] Stats module

2014-01-21 Thread Matthew Rocklin
== doesn't mean SymPy equality, it means Python equality. Try Eq(X, 3) instead. On Tue, Jan 21, 2014 at 9:07 AM, F. B. wrote: > > Concerning bugs and stats, is the following another bug? > > In [4]: X = Binomial('X', 4, S.Half) > > In [7]: density(X).dict > Out[7]: {0: 1/16, 1: 1/4, 2: 3/8, 3:

Re: [sympy] Stats module

2014-01-21 Thread F. B.
Concerning bugs and stats, is the following another bug? In [4]: X = Binomial('X', 4, S.Half) In [7]: density(X).dict Out[7]: {0: 1/16, 1: 1/4, 2: 3/8, 3: 1/4, 4: 1/16} In [8]: P(X > 2) Out[8]: 5/16 In [9]: P(X == 2) AttributeError: 'NoneType' object has no attribute 'probability' I would exp

Re: [sympy] Stats module

2014-01-18 Thread Aaron Meurer
Oh I didn't even notice that the summation is finite. So of course it converges. I think the algorithm computes finite sums by computing an infinite sum as an intermediary somehow (like summation(..., (k, 0, oo)) - summation(..., (k, n + 1, oo)); assuming my memory serves me correctly), but obvious

Re: [sympy] Stats module

2014-01-18 Thread F. B.
On Friday, January 17, 2014 11:27:49 PM UTC+1, Aaron Meurer wrote: > > > We'll have to see if the conditions for this integral can be improved. > Any idea what the full convergence conditions should be? > > That distribution is given by the polynomial expansion of *1 = ( p + (1-p) )^n*, the var

Re: [sympy] Stats module

2014-01-17 Thread Aaron Meurer
On Fri, Jan 17, 2014 at 11:24 AM, F. B. wrote: > > > On Friday, January 17, 2014 1:51:22 AM UTC+1, Aaron Meurer wrote: >> >> it seems it is not true if p > 0.5. >> > > No, this distribution is symmetric under { p ---> 1 - p, k ---> n - k } > substitution, it has surely to converge for 0 <= p <= 1

Re: [sympy] Stats module

2014-01-17 Thread someone
> Is there any list of papers/algorithms about summations? There is kind of a Todo list. I collected some material about symbolic summation. Do you want to do some coding in that direction? -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscrib

Re: [sympy] Stats module

2014-01-17 Thread F. B.
On Friday, January 17, 2014 1:51:22 AM UTC+1, Aaron Meurer wrote: > > it seems it is not true if p > 0.5. > > No, this distribution is symmetric under *{ p ---> 1 - p, k ---> n - k }*substitution, it has surely to converge for *0 <= p <= 1* > The summation module is just fine for this proble

Re: [sympy] Stats module

2014-01-16 Thread Aaron Meurer
On Thu, Jan 16, 2014 at 4:13 PM, F. B. wrote: > On Wed, Jan 15, 2014 at 1:17 PM, Matthew Rocklin wrote: >> >> Discrete is the newest and least mature and could presumably use work. > > > I tried to define a binomial distribution manually and do some calculations > using summation: > > In [1]: n,

Re: [sympy] Stats module

2014-01-16 Thread Matthew Rocklin
Yes, the summation module could certainly use more work. I think that this has been on the GSoC project list for a while. Fortunately this work can happen separately from work in stats. There is a pretty clear separation between the two modules. On Thu, Jan 16, 2014 at 2:13 PM, F. B. wrote:

Re: [sympy] Stats module

2014-01-16 Thread F. B.
On Wed, Jan 15, 2014 at 1:17 PM, Matthew Rocklin > wrote: > Discrete is the newest and least mature and could presumably use work. > I tried to define a binomial distribution manually and do some calculations using summation: In [1]: n, k = var('n k', positive=True, integer=True) In [2]: p =

Re: [sympy] Stats module

2014-01-15 Thread Matthew Rocklin
> we should think about providing built-in expected value formulas for common types like Binomial (which has a very simple formula that should return almost immediately even for large values). This is also a good idea. I want to say that this might almost exist already, at least for continuous va

Re: [sympy] Stats module

2014-01-15 Thread Matthew Rocklin
Background - SymPy.stats has three major components for three different kind of distributions Finite Random Variables - like dice, coins, and binomials -- uses Python iterators Continuous Random Variables - like normals, exponentials, and chi squares -- Uses SymPy Integrals Discrete Random Vari

[sympy] Stats module

2014-01-15 Thread Jonathan Miller
I recently downloaded SymPy and was looking to contribute to the stats module. I noticed a few things. 1) The Geometric and Poisson random variable types exist in the drv_types.py file, and I'm able to use them in code, but they aren't mentioned in the documentation ( http://docs.sympy.org/late