Re: How to fit complex valued data?
- To: mathgroup at smc.vnet.net
- Subject: [mg64147] Re: [mg64096] How to fit complex valued data?
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 2 Feb 2006 02:17:05 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
You could try fitting the absolute value since it depends on both the real and imaginary parts. You must test the result since you might get the sign of b wrong. expr[b_,x_]:=(1+I b x)^-1; b=Random[] 0.9831217471019718 data={#,expr[b,#]}&/@Range[10]//N; Clear[b]; Off[FindFit::fmgz]; FindFit[{#[[1]],Abs[#[[2]]]}&/@data, ComplexExpand[Abs[expr[b,x]]],b,x] {b -> 0.9831217471019714} Bob Hanlon > > From: James McCambridge <James.McCambridge at usa.dupont.com> To: mathgroup at smc.vnet.net > Subject: [mg64147] [mg64096] How to fit complex valued data? > > > 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 > parts. > > 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 > > http://www.DuPont.com/corp/email_disclaimer.html > > >