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

*To*: mathgroup at smc.vnet.net*Subject*: [mg126813] Re: Fitting complex functions or simultaneous fit of functions with identical parameters with Mathematica*From*: danl at wolfram.com*Date*: Sat, 9 Jun 2012 03:06:39 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com

On Friday, June 8, 2012 2:36:22 AM UTC-5, 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. > > 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. > > So, this does not work. > > What I then need is a recipe > > (a) that urges NonLinearFitModel to fit Re and Im to the corresponding > experimental data simultaneously and putting out one set of parameter > vaules for both of them. > > or > > (b) urging NonLinearFitModel to fit the complex DLM directly. > > I was looking for help in the net for quite a while and tried all the > proposals I found, but they simply do not work. > > I have the suspicion that my problem is not that rare and so I'd like > to ask the experts in this group for some enlightment. > > If possible, I'd prefer a do- it-yourself solution and not something > extended with libraries since I want to fiddle around with a potential > solution to customize it for my needs. > > Many thanks in advance for any helpful hints! > > cu > eastman See: http://forums.wolfram.com/mathgroup/archive/2012/May/msg00289.html Several notes relevant to this topic show up if you read this group via groups.google.com, and search comp-soft-sys.math.mathematica for 'simultaneous fit' (sans quotes). So I guess one viable hint would be "Check the group archives". Not my call really, but I agree it would be nice if the various Fit/Regress functions had direct support for complex-valued functions. Daniel Lichtblau Wolfram Research