Re: Does FindFit really use Norm[] when NormFunction -> Norm?
- To: mathgroup at smc.vnet.net
- Subject: [mg98327] Re: Does FindFit really use Norm[] when NormFunction -> Norm?
- From: Darren Glosemeyer <darreng at wolfram.com>
- Date: Wed, 8 Apr 2009 02:43:30 -0400 (EDT)
- References: <34b6e3d4-6741-4ee7-8b1f-12e6fcadd2a5@z14g2000yqa.googlegroups.com>
Szabolcs wrote: > [note: message sent to comp.soft-sys.math.mathematica] > > Today there was a question about fitting complex valued functions > again. It's not difficult to find the answer on MathGroup (posted by > Darren Glosemeyer): > > http://groups.google.com/group/comp.soft-sys.math.mathematica/msg/d31cd1dd0cb8519b > > But something doesn't seem to be right here ... Doesn't Norm[] return > a real number, so isn't Abs at Norm[...] really the same as Norm[...]? I > vaguely remembered that I already asked about this, and managed to > find the relevant thread: > > http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/24d2cad540e63729/dce449ac84966959 > > But no one has given a definite reply there. So I'll ask again: What > going on? Why does FindFit[..., NormFunction -> Norm] behave > differently from FindFit[..., NormFunction -> myNorm] when myNorm is > defined as myNorm[x___] := Norm[x]? > > Szabolcs > This has been pointed out to the developer for further consideration. What's happening now is that Norm is getting caught and the internal code uses default code (mathematically equivalent nonlinear least squares optimization code) which runs into some complexes in intermediate calculations. The Abs@Norm or myNorm NormFunction settings do not get caught and the complexes are not encountered. Darren Glosemeyer Wolfram Research