I'm trying to calculate the equation for linear regression with maxima but maxima can't solve the linear system:
Maxima 5.38.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) e: sum((y[i] - (a*x[i]+b))^2, i, 1, n);
n
====
\ 2
(%o1) > (y - a x - b)
/ i i
====
i = 1
(%i2) dea: diff(e, a, 1);
n
====
\
(%o2) - 2 > x (y - a x - b)
/ i i i
====
i = 1
(%i3) deb: diff(e, b, 1);
n
====
\
(%o3) - 2 > (y - a x - b)
/ i i
====
i = 1
(%i4) linsolve([dea, deb], [a, b]);
(%o4) []
Why is it empty? As far as I see maxima can't solve for variables in sums with some other variables. How can I fix it? Do I have to use another function or do I have to reorder my equations?