Working with sums/products of lists [closed]

asked 6 years ago

galio gravatar image

I need to work symbolically with expressions such as this

L(x;a,b)=ni=1abxa1i(1xai)b1

where x would be a random sample of size n.

I don't know of any way to express the indexing of the sample x by each element...

The closest I got was defining the variables n and i and representing x as a function

var('a','b','x','n','i')
assume(x>0,a>0,b>0,i>0,n>0)
X = function('X',nargs=1)
L = product(a*b*X(i)^(a-1)*(1-X(i)^a)^(b-1), i, 1, n)

But this seems to inmediately assume that X(i)=i and L is represented as:

(1)nanbnX(0)X(1)X(2)X(3)X(4)X(5)X(6)X(7)X(8)X(9)ni=1(X(i)a+1)bni=1X(i)aX(n1)X(n2)X(n3)X(n4)X(n5)X(n6)X(n7)X(n8)X(n9)X(n)ni=1X(i)a1ni=1X(i10)

I don't know how to deal with this expression, and it seems to me like it should be straight forward.

Preview: (hide)

Closed for the following reason duplicate question by tmonteil
close date 2019-01-06 13:36:49.485077