Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 591c941c2fdf0a32dc57bb5f10791cde > files > 202

gnuplot-doc-4.4.0-5.fc14.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Tips</TITLE>
<META NAME="description" CONTENT="Tips">
<META NAME="keywords" CONTENT="gnuplot">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="gnuplot.css">

<LINK REL="previous" HREF="node104.html">
<LINK REL="up" HREF="node94.html">
<LINK REL="next" HREF="node106.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html2479"
  HREF="node106.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html2473"
  HREF="node94.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html2469"
  HREF="node104.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html2475"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html2477"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2480"
  HREF="node106.html">Help</A>
<B> Up:</B> <A NAME="tex2html2474"
  HREF="node94.html">Fit</A>
<B> Previous:</B> <A NAME="tex2html2470"
  HREF="node104.html">Starting values</A>
 &nbsp; <B>  <A NAME="tex2html2476"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html2478"
  HREF="node467.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION04067000000000000000"></A>
<A NAME="commands_fit_tips"></A><A NAME="fit_tips"></A><A NAME="tips"></A><A NAME="2400"></A>
<BR>
Tips
</H2>
Here are some tips to keep in mind to get the most out of <B>fit</B>.  They're not
very organized, so you'll have to read them several times until their essence
has sunk in.

<P>
The two forms of the <B>via</B> argument to <B>fit</B> serve two largely distinct
purposes.  The <B>via <TT>"</TT>file<TT>"</TT></B> form is best used for (possibly unattended) batch
operation, where you just supply the startup values in a file and can later
use <B>update</B> to copy the results back into another (or the same) parameter
file.

<P>
The <B>via var1, var2, ...</B> form is best used interactively, where the command
history mechanism may be used to edit the list of parameters to be fitted or
to supply new startup values for the next try.  This is particularly useful
for hard problems, where a direct fit to all parameters at once won't work
without good starting values.  To find such, you can iterate several times,
fitting only some of the parameters, until the values are close enough to the
goal that the final fit to all parameters at once will work.

<P>
Make sure that there is no mutual dependency among parameters of the function
you are fitting.  For example, don't try to fit a*exp(x+b), because
a*exp(x+b)=a*exp(b)*exp(x).  Instead, fit either a*exp(x) or exp(x+b).

<P>
A technical issue:  the parameters must not be too different in magnitude.
The larger the ratio of the largest and the smallest absolute parameter
values, the slower the fit will converge.  If the ratio is close to or above
the inverse of the machine floating point precision, it may take next to
forever to converge, or refuse to converge at all.  You will have to adapt
your function to avoid this, e.g., replace 'parameter' by '1e9*parameter' in
the function definition, and divide the starting value by 1e9.

<P>
If you can write your function as a linear combination of simple functions
weighted by the parameters to be fitted, by all means do so.  That helps a
lot, because the problem is no longer nonlinear and should converge with only
a small number of iterations, perhaps just one.

<P>
Some prescriptions for analysing data, given in practical experimentation
courses, may have you first fit some functions to your data, perhaps in a
multi-step process of accounting for several aspects of the underlying
theory one by one, and then extract the information you really wanted from
the fitting parameters of those functions.  With <B>fit</B>, this may often be
done in one step by writing the model function directly in terms of the
desired parameters.  Transforming data can also quite often be avoided,
though sometimes at the cost of a more difficult fit problem.  If you think
this contradicts the previous paragraph about simplifying the fit function,
you are correct.

<P>
A <TT>"</TT>singular matrix<TT>"</TT> message indicates that this implementation of the
Marquardt-Levenberg algorithm can't calculate parameter values for the next
iteration.  Try different starting values, writing the function in another
form, or a simpler function.

<P>
Finally, a nice quote from the manual of another fitting package (fudgit),
that kind of summarizes all these issues:  <TT>"</TT>Nonlinear fitting is an art!<TT>"</TT>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2479"
  HREF="node106.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html2473"
  HREF="node94.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html2469"
  HREF="node104.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html2475"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html2477"
  HREF="node467.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2480"
  HREF="node106.html">Help</A>
<B> Up:</B> <A NAME="tex2html2474"
  HREF="node94.html">Fit</A>
<B> Previous:</B> <A NAME="tex2html2470"
  HREF="node104.html">Starting values</A>
 &nbsp; <B>  <A NAME="tex2html2476"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html2478"
  HREF="node467.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2010-08-17
</ADDRESS>
</BODY>
</HTML>