Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Max Likelihood -> sum of an array?' topicStudent Support Forum > General > Archives > "Max Likelihood -> sum of an array?"

< Previous CommentHelp | Reply To Comment | Reply To Topic
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: ,

Subject (listing for 'Max Likelihood -> sum of an array?')
Author Date Posted
Max Likelihood -> sum of an array? Charles Math... 02/28/12 1:16pm
Re: Max Likelihood -> sum of an array? Bill Simpson 02/29/12 2:08pm
Re: Re: Max Likelihood -> sum of an array? Charles 03/01/12 06:52am
Re: Re: Re: Max Likelihood -> sum of an array? Bill Simpson 03/01/12 11:02pm
< Previous CommentHelp | Reply To Comment | Reply To Topic