Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126812] Re: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica
  • From: Sseziwa Mukasa <mukasa at gmail.com>
  • Date: Sat, 9 Jun 2012 03:06:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201206080735.DAA13711@smc.vnet.net>

Replies inline below...

On Jun 8, 2012, at 3:35 AM, eastman wrote:

> Greetings to all!
>
> I have failed to solve a stubborn problem in fitting a complex- valued
> Drude-Lorentz model (DLM) to experimental data using the
> NonLinearFitModel of Mathematica. I'd prefer to do the fit with this
> procedure since the errors of the experimental data are also known and
> that procedure allows for weighting the fit with these errors.
>
> The problem is as follows:
>
> In terms of mathematics, the DLM is a complex-valued function of real
> arguments or a set of two real-valued functions  i.e. real and
> imaginary part. Obviously, both parts share the same set of
> parameters.
>
> Also obviously, fitting the real and imaginary part is not a good
> idea, since one generally gets different parameter values for Re and
> Im.
>
> My idea was to put the real and imaginary part into one new real
> function and I chose the square of the absolute value i.e. Re^2 +
> Im^2. Transforming the experimental data correspondingly as well as
> transforming the error data using the error propagation law, the fit
> results showed excellent coincidence of the combined function to the
> transformed data.

By doing this you've lost the phase information.

>
> So far, so good. But the problem is: Inserting the parameter values of
> this fit into Re and Im, the coincidence with the corresponding
> experimental data is much less impressive, if not crappy.

Because once you've lost the phase information it's unlikely that a good fit to your model is also a good fit to the original data.

Fortunately, NonlinearModelFit can fit to complex valued functions already:

In[2]:= NonlinearModelFit[RandomComplex[{-1-I,1+I},{10}],a+Ib,{a,b},x]
Out[2]= FittedModel[0.257386 -0.15977 I]

Regards,
	Ssezi



  • Prev by Date: Re: Bug in Spherical Plot 3D, Mathematica version 7
  • Next by Date: Re: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica
  • Previous by thread: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica
  • Next by thread: Re: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica