MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fitting to complex values

  • To: mathgroup at
  • Subject: [mg30801] Re: Fitting to complex values
  • From: "Lawrence A. Walker Jr." <lwalker701_remove_ at>
  • Date: Wed, 19 Sep 2001 00:16:41 -0400 (EDT)
  • References: <9nalpb$npj$> <9ncgqf$q1g$> <9nf6i0$sfj$>
  • Sender: owner-wri-mathgroup at

Hi Kevin,

Both NonlinearFit and Fit functions perform the least squares fit.  I 
found that both can be used on complex data directly.  Its just that Fit 
does it with basis functions that are linear combinations and 
NonLinearFit does it with a function you pick.  The method I proposed is 
one of perhaps many.  I chose this method because I felt it offered the 
flexibility in that the real part and imag part may very well have 
distinct behaviors which is conducive for two distinct functions or models.

On a side note however, I kept getting the following error when I tried 
to use NonlinearFit on the complex data directly:
"Less::nord: Invalid comparison with ... attempted."  Yet, Mathematica 
returned an 'exceptable' solution.  Should I disregard the error message?


Kevin J. McCann wrote:

> What about just doing a least squares fit? I have done this for complex data
> and it works fine.
> Kevin
> "Lawrence A. Walker Jr." wrote:
>>Hi Max,
>>Try dividing the complex data into two data sets: real and imaginary.
>>Then you can apply the NonlinearFit function twice.
>>For example
>>data = {{1, 1+2 I},{2, 3+4 I}, {3, 4+5 I}};
>>NonlinearFit[dataRe, func1, ...];
>>NonlinearFit[dataIm, func2, ...];
>>Note, you must specify the functions apriori.
>>Max Ulbrich wrote:
>>>I have complex data (re+im) from a lock-in amplifier and want to fit
>>>to a complex function. Though, the NonlinearFit function doesn't work
>>>with complex data. Has anyone a solution?


  • Prev by Date: Re: Combinations
  • Next by Date: Re: Math 1 Fonts Problem, Another Aspect
  • Previous by thread: Re: Fitting to complex values
  • Next by thread: Re: newbie: all possible sums of two lists