[sympy] sympy.stats how to lambdify with array arguments

2013-08-29 Thread Janwillem van Dijk
I have problems lambdifying a symbolic function that needs array arguments. The problem I want to solve is to find the statistics of the product of Normal distributions. Attached is an example that works and even yields the correct answers. However, I think that the part where the symbolic versio

Re: [sympy] sympy.stats how to lambdify with array arguments

2013-08-29 Thread Matthew Rocklin
Is the following snippet of use? In [1]: from sympy.stats import * In [2]: n = 5 In [3]: mus = [Symbol('mu'+str(i), bounded=True) for i in range(n)] In [4]: sigmas = [Symbol('sigma'+str(i), positive=True) for i in range(n)] In [5]: Xs = [Normal('X'+str(i), mu, sigma) for i, (mu, sigma) in enum

Re: [sympy] sympy.stats how to lambdify with array arguments

2013-08-30 Thread Janwillem van Dijk
T hanks Matthew, Is the following snippet of use? Yes and No. The lines 5 and 6 are a useful tip; I missed the prod method, that is nice. And yes for two N-distributions explicit solutions are to be found in the litt and SymPy can find t

Re: [sympy] sympy.stats how to lambdify with array arguments

2013-08-30 Thread Matthew Rocklin
The first input to lambdify should be either a SymPy expression or a list of SymPy expressions. I don't know enough about lambdify to know if we support list of lists of sympy expressions. In general you won't be able to use lambdify with arbitrary n because the target expression (the second argu

Re: [sympy] sympy.stats how to lambdify with array arguments

2013-08-31 Thread Janwillem van Dijk
Hallo again, Yes that was about the point I arrived at and I didn't like the *(mu + s) construct (having a history of algol and pascal). This morning (European time) I decided to do an other search and not stop reading on the second page. than I found out ( http://questiontrack.com/how-to-substi