Re: lsqnonlin question again



In article <ef15d59.-1@xxxxxxxxxxxxxxxx>,
"Anand Seshadri" <hokiepride2000NOSPAM@xxxxxxx> wrote:

> I use lsqnonlin to minimize a function with 10 components, and the
> end of the procedure, i get the residuals which should be as close to
> zero as possible. However, the sum of the values of the residuals
> ,rather than the sum of squares add up to zero. For example the
> residuals for a 3 component function are 0.01,0.02,-0.03. MATLAB
> claims that the component vector is explicitly squared and summed in
> the lsqnonlin code, but this behavior is making me suspect that the
> sum, rather than the sum-of-squares is being minimized.

A property of ANY linear regression with an additive
constant term to be estimated in the model (I should
be able to prove this also applies to any nonlinear
regression model with the same characteristics) is
that the minimum sum of squares must coincide with
residuals that sum exactly to zero. This is only true
to within floating point precision of course.

While you do not say what your model is, or if it
contains a constant term or some combination of terms
that are equivalent to one, I am fairly confident
that one is in there.

Finally, there is no assurance that a solution ever
exists with zero sum of squares, but it is absolutely
true that lsqnonlin attempts to minimize the sum of
squares of the residuals.

HTH,
John D'Errico


--
The best material model of a cat is another, or
preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
.



Relevant Pages

  • Re: Least squares optimizing for equal positive & negative error sums
    ... I'm looking for something that will generate coefficients similar to typical least squares analysis, but instead optimizes for an equal amount of positive and negative error between the polynomial and the measured data. ... You could use an augmented objective function which is the sum of the squares of the fitting errors, PLUS some big whopper constant times the difference between the sum of positive errors and the sum of negative errors. ... Compute the residuals, and find the sum of the positive ...
    (comp.soft-sys.matlab)
  • Re: least square nonlinear
    ... In the lsqnonlin function menu, ... said that to use lsqnonlin as a minimization function, ... have a sum of squares, take the squares out, and run it through ... function of functions that are a sum of squares. ...
    (comp.soft-sys.matlab)
  • Calculating Standard Deviation
    ... Here is the first of my statistics/least squares questions... ... When calculating the standard deviation for a set of values you use the ... sum of all the residuals squared. ... Is this done to remove the tendency for residuals that result from ...
    (sci.math.num-analysis)
  • Re: lsqnonlin - any difference for myfunc() to return vector or norm(vector)^2 ?
    ... The documentation says to return a vector of residuals ... but I prefer to return the sum of squares error - is there any ...
    (comp.soft-sys.matlab)
  • Re: fminsearchbnd not finding right values (when between upper & lower limit)
    ... FitEr = trapz); ... Just sum the absolute ... residuals, or sum the squares of the residuals. ...
    (comp.soft-sys.matlab)