MathGroup Archive 2006

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

Search the Archive

Re: How to fit complex valued data?

  • To: mathgroup at
  • Subject: [mg64131] Re: [mg64096] How to fit complex valued data?
  • From: Darren Glosemeyer <darreng at>
  • Date: Thu, 2 Feb 2006 00:05:59 -0500 (EST)
  • Sender: owner-wri-mathgroup at

One possibility is to use FindFit with a non-default NormFunction that 
returns a real value even when residuals have imaginary parts.  For instance,

FindFit[data, expr[b, y], {{b, 1.}}, y, NormFunction -> (Abs[Norm[#]] &)]

which uses the absolute value of the sum of squared errors rather than the 
default sum of squared errors, works fine in this example.

Darren Glosemeyer
Wolfram Research

At 04:34 AM 2/1/2006 -0500, James McCambridge wrote:

>Esteemed Colleagues,
>I would like to fit a complex valued data set with FindFit (I'm willing to
>try other methods too, but I thought I'd start out with the basics). Is
>this possible?
>For example, I am interested in fitting the complex permittivity of liquid
>polymers vs frequency, which has a functional form:
>In[1]:=    expr[b_,x_]:=(1+I b x)^-1;
>Using this form to generate data, with b = 1.0, I get:
>In[2]:=    data ={{1,0.5 -0.5 I},{2.,0.2 -0.4 I},{3.,0.1 -0.3 I
>},{4.,0.0588235 -0.235294 I},{5.,0.0384615 -0.192308 I},{6.,0.027027
>-0.162162 I},{7.,0.02 -0.14 I},{8.,0.0153846 -0.123077 I},{9.,0.0121951
>-0.109756 I},{10.,0.00990099 -0.0990099 I}};
>Using FindFit, I come up against an error message.
>In[3]:=   FindFit[data,expr[b,y],{{b,1.}}, y]
>has the output
>Out[3]:=   FindFit::nrlnum: The function value {0.+0. I, 0.+0. I, -1.38778
>10^-17+0. I, <<4>>, 0.+0. I, 0.+0. I, 0.+0. I} is not a list of real
>numbers with dimensions {10} at {b} = {0.}
>The form expr[0.,x] doesn't look poorly behaved, so what gives?
>I could separately fit the real and imaginary components, but this often
>gives two somewhat different sets of parameters; I would like to obtain
>the parameters which optimize the fit to BOTH the real and imaginary
>Your comments and suggestions are greatly appreciated!
>Jim McCambridge
>This communication is for use by the intended recipient and contains
>information that may be Privileged, confidential or copyrighted under
>applicable law. If you are not the intended recipient, you are hereby
>formally notified that any use, copying or distribution of this e-mail,
>in whole or in part, is strictly prohibited. Please notify the sender by
>return e-mail and delete this e-mail from your system. Unless explicitly
>and conspicuously designated as "E-Contract Intended", this e-mail does
>not constitute a contract offer, a contract amendment, or an acceptance
>of a contract offer. This e-mail does not constitute a consent to the
>use of sender's contact information for direct marketing purposes or for
>transfers of data to third parties.
>Francais Deutsch Italiano  Espanol  Portugues  Japanese  Chinese  Korean

  • Prev by Date: Re: Utilizing the Result From Solve[]
  • Next by Date: Re: How to evaluate the following expression in Mathematica?
  • Previous by thread: Re: How to fit complex valued data?
  • Next by thread: Re: How to fit complex valued data?