Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
nlinfit with complex numbers

Subject: nlinfit with complex numbers

From: Denys

Date: 21 Jun, 2011 08:00:20

Message: 1 of 4

I read that nonlinear regression does not work with complex numbers (lsqcurvefit, nlinfit...).
So I changed the formulation to split all complex numbers into real/imaginary numbers.
But I tried also using complex numbers and parameters, and it works !
Both results are similar (and seem good) BUT :
- calculation with reals is much slower
- calculation with reals provide confidence intervals very high (although the fit is correct), e.g. 1e7 for parameters refined around 0.3...
- I cannot obtain confidence intervals with complex (nlparci) (error message)

Questions :
Is it true that nlinfit does not work with complex ???
Why confidence intervals are so high with reals ?

Thanks for help

Subject: nlinfit with complex numbers

From: Peter Perkins

Date: 21 Jun, 2011 13:34:44

Message: 2 of 4

On 6/21/2011 4:00 AM, Denys wrote:
> I read that nonlinear regression does not work with complex numbers
> (lsqcurvefit, nlinfit...).

> Questions : Is it true that nlinfit does not work with complex ???
> Why confidence intervals are so high with reals ?

NLINFIT does accept and properly handle complex data. The estimated
coefs will in general be complex.

Subject: nlinfit with complex numbers

From: Denys

Date: 24 Jun, 2011 07:21:02

Message: 3 of 4

Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <itq6lk$m86$1@newscl01ah.mathworks.com>...
> On 6/21/2011 4:00 AM, Denys wrote:
> > I read that nonlinear regression does not work with complex numbers
> > (lsqcurvefit, nlinfit...).
> > Questions : Is it true that nlinfit does not work with complex ???
>
> NLINFIT does accept and properly handle complex data. The estimated
> coefs will in general be complex.


OK, this was not obvious at all in the matlab help...

Now, how may I obtain confidence intervals since nlparci gives error message with complex ??

Thanks again for help

Subject: nlinfit with complex numbers

From: Peter Perkins

Date: 24 Jun, 2011 16:59:36

Message: 4 of 4

On 6/24/2011 3:21 AM, Denys wrote:
> Now, how may I obtain confidence intervals since nlparci gives error
> message with complex ??

For that, you will have to break the problem up into real and complex parts.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us