Variable "i" disable function lsquares. This defect I have long sought.
I used only the commands for repeating mistakes
1. This is well:
kill(all);
load(lsquares);
M: matrix([1,2],[2,4],[3,9])$
eq: y = A + B*x$
lsquares_estimates(M,[y,x],eq,[A,B]);
values;
(%o4) [[A=17/26,B=7/26]]
(%o5) [M,eq,solutions]
2. This is wrong:
M: matrix([1,2],[2,4],[3,9])$
eq: y = A + B*x$
i:0$
lsquares_estimates(M,[y,x],eq,[A,B]);
values;
apply: no such "matrix" element: [0,1]#0:
lsquares_estimates_exact(mse=(-'data[0,2]*B-A+'data[0,1])^2,parameters=[A,B])#1:
lsquares_estimates(data=matrix([1,2],[2,4],[3,9]),variables=[y,x],equation=y
= x*B+A,parameters=[A,B],optional_args=[])(lsquares.mac line 245) -- an
error. To debug this try: debugmode(true);
(%o10) [M,eq,solutions,i]
Derka