Author 
Comment/Response 
Bill Simpson

03/01/12 11:02pm
In Response To 'Re: Re: Max Likelihood > sum of an array?'  Thank you for including SMLE.m.
For the moment I won't use that and will try to address your trying to form an arbitrary sum by entering the following:
In[1]:= \!\(s = Sum[Y\_i, {i, 1, n}]\)
Out[1]= \!\(∑\+\(i = 1\)\%n Y\_i\)
In[2]:= s/.{n\[Rule]4}
Out[2]= \!\(Y\_1 + Y\_2 + Y\_3 + Y\_4\)
In[3]:= data={1,0,3,4}
Out[3]= {1,0,3,4}
In[4]:= \!\(s /. {n \[Rule] 4, Y\_i \[RuleDelayed] data[\([i]\)]}\)
Out[4]= 8
You will need to see how to back translate that into what you would type on your keyboard so that you can reproduce this yourself.
So as long as n is not given a value Mathematica maintains this as a summation. When n is given a fixed value that sum is converted into an addition, but the individual terms remain unknown. And when both n and the individual terms are given this turns into a number.
I am guessing this doesn't go far enough to answer what your real question is, but it does show how I was able to define a sum of an unknown number of elements, save that in s and later manipulate that. You might then use SMLE to manipulate such a sum to obtain the result you are looking for.
Does this seem like we are getting a little closer to what you are trying to accomplish?
URL: , 
