[Date Index] [Thread Index] [Author Index]
Re: Does FindFit really use Norm when NormFunction -> Norm?
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