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