[R] Regression of complex-valued functions

Andrea Graziani a.graziani at mail.com
Sun Jan 26 01:55:54 CET 2014

I tried to use nls() to fit a complex-valued (non linear) function that 
looks like this:
y = A + B / (1 + C * (i*x*D)^E)
where x is the real-valued independent variable,  A,B,C,D,E are 
real-valued parameters and i is the imaginary unit.

I had the followin error (my translation into english):
"Error in numericDeriv(form[[3L]], names(ind), env) :
missing value or infinity generated during model calculation"

And a lot of warnings (my translation into english):
"In numericDeriv(form[[3L]], names(ind), env) :
imaginary parts removed during the conversion"

If I got it right R  is non able to handle regression problems on 
complex-valueed function, correct?
If yes, is there some workaround?
For example using MSExcel I fit the real and imaginary parts separately, 
and than I minimize the sum of the SSE using the solver function.
Quite rude, but it works...

thank you for your help

More information about the R-help mailing list