Working with sums/products of lists [closed]
I need to work symbolically with expressions such as this
L(x;a,b)=∏ni=1abxa−1i(1−xai)b−1
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)b∏ni=1X(i)aX(n−1)X(n−2)X(n−3)X(n−4)X(n−5)X(n−6)X(n−7)X(n−8)X(n−9)X(n)∏ni=1X(i)a−1∏ni=1X(i−10)
I don't know how to deal with this expression, and it seems to me like it should be straight forward.