Re: complex function fitting?
- To: mathgroup at smc.vnet.net
- Subject: [mg98331] Re: complex function fitting?
- From: "Ned Lieb" <okty.gy.ned at gmail.com>
- Date: Wed, 8 Apr 2009 02:44:13 -0400 (EDT)
- References: <grcgjg$pml$1@smc.vnet.net> <49D9DDF3.30605@metrohm.com>
Just a clarification of my original question: I'm referring to a specific issue I'm having using the NonlinearModelFit function, which fits lists of data-points to functions of a type specified by the user (for example, say I knew that my data fit an exponential equation (it doesn't, by the way, this is just an example) with x as an independent variable: NonLinearModelFit could find the constant A in the equation A*e^x that would give the function that most closely approximated my data). My list of data is complex-valued (with non-zero imaginary components). Mathematica returned an error message saying I could only use real numbers. I was wondering whether there was a way to get around this. Thanks -----Original Message----- From: dh [mailto:dh at metrohm.com] Sent: Monday, April 06, 2009 6:48 AM To: Ned Lieb Subject: [mg98331] Re: complex function fitting? Hi Ned, Mathematica works by default with complex numbres. E.g. using "Fit": d = Table[{x + I y, Exp[x + y I ]}, {x, 0, 1, .1}, {y, 0, 1, .1}]; d = Flatten[d, 1]; pol = Fit[d, {1, x, x^2}, x] yc = pol /. x -> d[[All, 1]]; ListPlot[{Re[#], Im[#]} & /@ (yc - d[[All, 2]]), PlotRange -> All] Daniel Ned Lieb wrote: > Does anyone know how I could extend the domain of Mathematica's > function-fitting functions so I can use complex-valued data? > > >