Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Unstable solutions to NonlinearFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32418] Unstable solutions to NonlinearFit
  • From: ashcroft at remss.com (Peter Ashcroft)
  • Date: Sat, 19 Jan 2002 01:17:18 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I'm having trouble using the NonlinearFit function to
find the best fit for some data.  I get answers, but
in some cases they appear nonsensical.  Also, I notice
that the Confidence Intervals are *very* large for some
of the parameters.

The data in question describes antenna gain patterns, and
has a very large dynamic range.  I suspect that this large
range of data values (from 10^-8 to 1) is the reason that
some of the parameters are estimated so badly.

Simply looking at a plot of the data on a logarithmic
scale suggests that it could be fit well by something of
the form: Exp[b r1^2] + Exp[c + d r1] + 10^f

(In other words, the data has an Exp[b r1^2] part for
small values of r1, a slowly diminishing Exp[c + d r1]
part for larger values of r1, and eventually plateaus
at some constant positive value.)

Here's an example where the fit doesn't turn out so well,
(as judged by a plot of the fit on a logarithmic scale,
and the confidence intervals that are very large).

NonlinearRegress[linearvpairs,  
  Exp[b r1^2] + Exp[c + d r1] + 
    10^f, {r1}, {{b, -1}, {c, -1}, {d, -1}, {f, -1}}, 
  RegressionReport -> {BestFit, AsymptoticCorrelationMatrix, 
      ParameterCITable}]

BestFit -> 
      3.649189*10^-9 + E^(-16.209103 - 4.15162 r1) + E^(-4.106467 r1^2)

ParameterCITable->	Estimate	Asymptotic SE	CI
		b	-4.1064		0.0139	        -4.13384,-4.0790
		c	-16.209		30903.73	-60595.3,60562.8
		d	-4.1516		236105.04	-462829.,462821.
		f	-8.4378		5643.3565	-11070.8,11053.9

Note that "b" has a tight cinfidence interval, but the others 
are extremely large.

Here's another example that's even more pathological.  I don't
know what subtlety of the data differentiates this case from the
one above.  (All the data sets look fairly similar on visual 
inspection.)

NonlinearRegress[linearhpairs,  
  Exp[b r1^2] + Exp[c + d r1] + 
    10^f, {r1}, {{b, -1}, {c, -1}, {d, -1}, {f, -1}}, 
  RegressionReport -> {BestFit}]

BestFit -> 
    3.772468*10^-313 + E^(-3.974 r1^2) + E^(-22.626 + 1.698 r1)

Note the 10^-313!  I couldn't even compute the confidence
intervals in this case.

I know that I could get much better behaved fits if I
fitted to the logarithm of the data rather than the
data itself, but I would prefer to fit to the data
directly if possible.  (Reasoning that what I want to
minimize is the sum of the squared error in power
rather than the squared error in log of the power.)

Does anyone have any suggestions for how I might set
the NonlinearFit options in order to get more stable
results?  Thanks.


  • Prev by Date: When does x/x not equal 1?
  • Next by Date: Re: Mysterious 3-way Collision of Polygons
  • Previous by thread: Re: When does x/x not equal 1?
  • Next by thread: Re: Unstable solutions to NonlinearFit