Re: How to do a Nonlinear Complex Fit ?
- To: mathgroup at smc.vnet.net
- Subject: [mg22469] Re: How to do a Nonlinear Complex Fit ?
- From: Dr Dan <drdanw at my-deja.com>
- Date: Sun, 5 Mar 2000 00:24:03 -0500 (EST)
- References: <89ibb1$mu4@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I've done complex curve fitting in lower level programming languages by altering the definition of chi squared and its gradient in the Numerical Recipes algorithm. As far as I am aware, there is no way to redefine the chi squared function in NonlinearFit. I have successfully fit complex functions with NonlinearFit by instead fitting the modulus squared. The modulus squared of the fit function is best calculated as: SqrFnc[f_] := Chop[ ComplexExpand[Numerator[f]*Conjugate[Numerator[f]]] /. I -> 0, 10^(-50)]/ Chop[ComplexExpand[Denominator[f]*Conjugate[Denominator[f]]] /. I -> 0, 10^(-50)] This works for me because I know my function is minimum phase, so there is no loss of information in squaring the function. This may not be the case for you. In article <89ibb1$mu4 at smc.vnet.net>, Ronald Sastrawan <sastra at fmf.uni-freiburg.de> wrote: > Hello! > > I am trying to fit a complex function to real data. The data consists of > real and imaginary part. > Now, I can fit both real and imaginary parts seperately using the > NonlinearFit. Can someone explain how to fit both components with the > same set of parameters, i.e complex fitting? > > Thank you, > > -- > Ronald Sastrawan > > Freiburg Materials Research Center > Stefan-Meier-Str. 21 > D-79104 Freiburg > Germany > Tel: ++49/761/203-4802 > FAX: ++49/761/203-4801 > EMAIL: sastra at fmf.uni-freiburg.de > http://www.fmf.uni-freiburg.de/~biomed/FSZ/forschung-FSZ.html > > Sent via Deja.com http://www.deja.com/ Before you buy.