Re: Nonlinear fit for a non-differentiable function
- To: mathgroup at smc.vnet.net
- Subject: [mg43154] Re: Nonlinear fit for a non-differentiable function
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Thu, 14 Aug 2003 07:06:39 -0400 (EDT)
- Organization: The University of Western Australia
- References: <bhd94f$rn9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <bhd94f$rn9$1 at smc.vnet.net>, Ahmed Sayeed <Ahmed.Sayeed at Tu-Ilmenau.De> wrote: > I have to carry out a nonlinear fit where the fit function is > non-differentiable w.r.t. one or > more of the parameters, because I have to take the absolute value in the > definition of the function. > For example, f[x_,a_,b_]:=a*Sin[Abs[b]*x], where a and b are fit parameters. > NonlinearRegress > fails, giving the following message: > NonlinearRegress::"unevldr": "One or more derivatives of the model with \ > respect to parameters did not evaluate." > I shall be grateful if someone could suggest a way around this problem. One way might be to replace Abs[b] by Sqrt[b^2] (valid for b real) which is differentiable. Cheers, Paul -- Paul Abbott Phone: +61 8 9380 2734 School of Physics, M013 Fax: +61 8 9380 1014 The University of Western Australia (CRICOS Provider No 00126G) 35 Stirling Highway Crawley WA 6009 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul