[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nlinfit in octave
From: |
Olaf Till |
Subject: |
Re: nlinfit in octave |
Date: |
Sun, 16 Aug 2015 22:16:22 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sun, Aug 16, 2015 at 11:51:11AM +0100, Asma Afzal wrote:
> I have made the changes in [1-4]
I've not completed the review, but AFAICS there is a fundamental
misunderstanding in your nlinfit code: It's not considered that
nonlin_residmin applies the specified weights as factors to the
residuals, while Matlabs nlinfit seems to apply the specified weights
to the squared residuals (i.e., applies the squareroot of the
specified weights to the residuals).
If you make a new revision, please also make this changes:
- Don't state in the documentation 'using Iteratively Reweighted Least
Squares (IRLS) Method' because it's not true for our backend.
- if (nargs==6 || nargs > 7)
+ if (nargs < 4 || nargs==6 || nargs > 7)
print_usage ();
endif
- Check and correct code indentation.
> updated my repository with the
> current versions of lsqnonlin and lsqcurvefit.
Comparing them still shows differences:
diff ../optim/inst/lsqnonlin.m octave_workspace/lsqnonlin.m
125,126d124
< ##
< ## @seealso {lsqcurvefit, nonlin_residmin, nonlin_curvefit}
314c312
< %! lsqnonlin(@(p) myfun(p, x, y), p0, lb, ub, opts)
---
> %! lsqnonlin(@(p) myfun(p, x, y), p0, lb, ub, opts)
\ No newline at end of file
diff ../optim/inst/lsqcurvefit.m octave_workspace/lsqcurvefit.m
124,125d123
< ##
< ## @seealso {lsqnonlin, nonlin_residmin, nonlin_curvefit}
299c297
< %! J = [exp(- p(2) * x), - p(1) * x .* exp(- p(2) * x)];
---
> %! J = [exp (- p(2) * x), - p(1) * x .* exp (- p(2) * x)];
316c314
< %! lsqcurvefit (@ (varargin) myfun(varargin{:}), p0, x, y, lb, ub, opts)
---
> %! lsqcurvefit (@ (varargin) myfun(varargin{:}), p0, x, y, lb, ub, opts)
\ No newline at end of file
Within brackets, there must not be spaces between 'function name' and
'argument list in parantheses' (i.e. [exp (...)] does not work). This
is what I meant when I criticized that you should run and check the
code of your test blocks.
Olaf
--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net
signature.asc
Description: Digital signature
- Re: nlinfit in octave, Asma Afzal, 2015/08/14
- Re: nlinfit in octave, John W. Eaton, 2015/08/14
- Re: nlinfit in octave, Asma Afzal, 2015/08/14
- Re: nlinfit in octave, Olaf Till, 2015/08/15
- Re: nlinfit in octave, Asma Afzal, 2015/08/16
- Re: nlinfit in octave,
Olaf Till <=
- Re: nlinfit in octave, Asma Afzal, 2015/08/17
- statistics package more suitable for nlinfit et al.? (was: Re: nlinfit in octave), Olaf Till, 2015/08/19
- Re: statistics package more suitable for nlinfit et al.?, Julien Bect, 2015/08/20
- Message not available
- Re: statistics package more suitable for nlinfit et al.? (was: Re: nlinfit in octave), Nir Krakauer, 2015/08/19
- Re: statistics package more suitable for nlinfit et al.? (was: Re: nlinfit in octave), Olaf Till, 2015/08/20