Here might be an easy way to get started:
(%i24) f(x,m,s):=(1/(s*sqrt(2*%pi)))*%e^(-((x-m)^2)/(2*s^2))$
(%i25) dL_dm(X,m,s):=lsum(''(diff(log(f(x,m,s)),m)),x,X)$
(%i26) dL_ds(X,m,s):=lsum(''(diff(log(f(x,m,s)),s)),x,X)$
(%i27) ratsimp([dL_ds(X,m,s), dL_dm(X,m,s)]);
(%o27) [lsum((x^2-2*m*x-s^2+m^2)/s^3,x,X),lsum((x-m)/s^2,x,X)]
Let us know if this idea doesn't work for you or if you have other
questions. You could try to define rules that will swap diff & lsum.
I didn't try that.
Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>To:?maxima at math.utexas.edu
>From:?Athanasios?Anastasiou?<athanastasiou at googlemail.com>
>Sent?by:?maxima-bounces at math.utexas.edu
>Date:?03/16/2009?07:33AM
>Subject:?[Maxima]?A?slight?issue?with?a?series?in?WxMaxima
>
>Hello?Everyone
>
>I?am?trying?to?carry?out?some?symbolic?computations?with?WxMaxima?and
>while?i?can?find?a?workaround?to?what?i?am?trying?to?do,?i?thought?i?might
>check?the?list's?wisdom?for?any?better?alternatives.
>
>
>I?am?trying?to?do?Maximum?Likelihood?Estimation?(MLE)?on?a?model?that?has
>a?number?of?parameters.?However,?before?i?dive?directly?into?this,?i
>thought?i?might?try?the?simple?gaussian?MLE?first,?as?a?small?practical
>example.
>
>
>So,?i?define?a?function?that?returns?the?gaussian?pdf?as:
>f(x,m,s):=(1/(s*sqrt(2*%pi)))*%e^(-((x-m)^2)/(2*s^2));
>
>And?then?i?define?the?likelihood?function?of?this?as:
>L(X,m,s):=lsum(log(f(x,m,s)),x,X);
>
>
>This?function?has?indeed?a?local?maximum?when?m,s?are?matched?to?the?mean
>and?standard?deviation?of?a?guassian?process?that?returned?the?sample?X.
>
>m,s?can?be?calculated?in?a?number?of?different?ways.?Most?of?these?ways
>involve?at?some?point?the?derivation?of?all?partial?derivatives?of?L?with
>respect?to?each?model?parameter.
>
>
>Now,?if?i?try?to:
>diff(L(X,m,s),m)
>
>without?having?set?values?for?X,?i?get?exactly?what?i?typed.?In?other
>words,?the?diff?expression?is?not?even?expanded?on?X.
>
>Is?there?something?additional?i?should?be?doing?to?get?the?full?symbolic
>expression?for?diff(L(X,m,s),m)?in?maxima?
>
>
>The?workaround?i?found?was?to?go?ahead?and?set?values?for?X?and?then?ask
>for?the?diff?again?like:
>X:[5,4,6,4,3,5];
>diff(L(X,m,s),m);
>
>I?now?get?the?diff?expression?as?a?series?expansion?on?X?which?i?can
>"re-write"?so?that?it?is?not?expressed?with?the?explicit?values?of?X?but
>with?general?X1,?X2,?X3,...Xn.?However,?i?suspect?that?this?is?a?somewhat
>simple?case.
>
>
>In?trying?to?solve?this,?i?had?a?look?around?in?the?internet?and?noticed
>that?sometimes?the?series?that?the?likelihood?function?L?introduces?goes
>directly?to?the?exponent?of?e?in?the?gaussian?pdf.?Is?this?common?practice
>when?dealing?with?a?series??Are?there?any?mathematical?"identities"?for
>the?treatment?of?series?in?cases?like?these??If?yes,?could?you?please
>point?any?relevant?reference?bibliography??(I?may?be?searching?with?the
>wrong?terms?:-/)
>
>
>Other?than?this,?i?would?like?to?say?that?i?have?recently?started?using
>maxima?as?an?alternative?to?commercial?packages?and?i?must?say?that?it?has
>been?very?useful?to?me?particularly?because?it?is?light?enough?to?run?on
>my?lightweight?1.4Ghz,?512MB?RAM?laptop.
>
>
>Looking?forward?to?hearing?from?you
>Athanasios
>
>_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima