differentiation of arbitrary matrix expressions



On Thursday, July 11, 2013 02:18:36 PM Ross Boylan wrote:
> Given
> phi(x) := exp(-x^2/2)/sqrt(2*%pi);
> Phi(x) := integrate(phi(z), z, -inf, x);
> I get
> P : tau^(-2) *Phi(Q)^y*(1-Phi(Q))^(1-y)*phi(theta/tau);
> Maxima encountered a Lisp error:
>  Error in PROGN [or a callee]: Bind stack overflow.
> Automatically continuing.
> To enable the Lisp debugger set debugger-hook to nil.
I get that error when I evaluate it in wxmaxima using a workbook from my 
earlier session (which was on windows; currently on linux).  But when I start 
maxima from scratch inside of emacs, there are no complaints.

I can't see anything in the workbook that would account for the problem, 
although I did do
Phi(x) := ....
phi : Phi
Phi := integrate (phi(z), z, -inf, x)

diff(subst(X.beta+theta,Q,P), beta);
also worked, or at least gave an answer.

I had no nonscalar declarations in emacs, though adding them doesn't seem to 
have hurt.

Puzzling.  Also, I have no idea why the work-around workd!
Ross