2009/3/16 Athanasios Anastasiou <athanastasiou at googlemail.com>:
> Is there something additional i should be doing to get the full symbolic
> expression for diff(L(X,m,s),m) in maxima?
diff doesn't seem to know that it can distribute over lsum;
this is just an oversight. A couple of ideas:
(1) use sum instead of lsum; 'sum prevents expansion into a literal sum
(2) devise a simplification rule:
matchdeclare ([xx, yy, LL], symbolp, aa, all);
simp : false;
tellsimp ('diff ('lsum (aa, yy, LL), xx, 1), 'lsum ('diff (aa, xx, 1), yy, LL));
simp:true;
diff (lsum (f(x, y), y, L), x);
=> 'lsum('diff(f(x,y),x,1),y,L)
> 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?
Not sure what you mean, but maybe "logexpand" is useful.
log ('product (exp (x [i]), i, 1, n));
=> log('product(%e^x[i],i,1,n))
log ('product (exp (x [i]), i, 1, n)), logexpand=all;
=> 'sum(x[i],i,1,n)
Let me know when you are ready to try the full problem.
Actually I found Maxima when I was working on a statistical problem myself ...
that was just about 6 years ago. How time flies.
Robert Dodier