On 2012-10-12, Przemek Klosowski <przemek.klosowski at nist.gov> wrote:
> I tried to get expressions for linear regression. First I defined the
> sum of squares:
>
> sumsq:sum((y[i]-a*x[i]-b)^2,i,1,N);
>
> then tried to solve for the minimum (derivatives of coefficients must be
> zero at solution:
>
> solve([diff(sumsq,a),diff(sumsq,b)],[a,b]);
>
> Maxima doesn't find anything (thinks solution is empty). What am I doing
> wrong?
I think you need declare(sum, linear) so that a and b are moved out of
summations (sum isn't declared linear by default).
You might also need to apply 'expand' to the derivatives to pull out a
and b.
best,
Robert Dodier