[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


mpfiterror Source code in mpfiterror.pro

mpfiterror

Name
        mpfiterror
Purpose
        compute two-sided, asymmetric error bars for a chi^2 fit
Category
        function fitting
Calling Sequence
         result=mpfiterror(fnctn,x, y,err,start_params, weights=weights, $
                   parinfo=pari,bestnorm=chi2, $
                   delchi=delchi,toldel=toldel, $
                   debug=debug,intpar=intpar,...)
Input Parameters
          similar to mpfitfun, see the documentation of mpfitfun
          for an exhaustive explanation.
          The input-parameter bestpar is the best-fit vector as returned
          from mpfitfun, perror is the "uncertainty" (i.e. the
          diagonal elements of the Hessian matrix) as returned from
          jwcurvefit.
        fnctn: name of the fit function
        x,y,err: x- and y-value, and error
        start_params: if given, best fit parameter values for which
           the error is to be computed. I recommend use of the
           parinfo structure instead (see below)
Keyword Parameters
        parinfo: structure containing parameter information,
           required. If start_params are not given, the value tag
           should contain the best fit value of each parameter
        bestnorm= the chi^2 value of the best fit
                 as returned from mpfitfun (bestnorm keyword)
        debug= return tons of debugging information.
                     1: basic information
                     2: current try value
                     3: detailed information
        intpar= array containing the indexes of all interesting
                 parameters, i.e., those for which the uncertainty
                 is to be computed (note: although the word
                 interesting is used here, this is not to be confused
                 with the notion of "interesting parameters" in chi^2
                 minimization)
        delchi= delta chi^2 to be used for the determination of
                 the uncertainty. default: 1, corresponding to 1
                 sigma errors. Use 2.71 for 90% uncertainty
                 (in general, delchi=chisqr_dvf(1-prob,1) where
                 prob is the probability that the n dimensional
                 parameter space spanned by the uncertainties
                 contains the real value)
        maxtry= maximum number of invocations of mpfitfun in the
                 determination of ONE error (used to determine
                 non-convergence).
        toldel= max. allowed relative deviation between
                 chi2min+delchi and the current chi^2 value. used to
                 define precision of the bounds.
        chierr= 2d array, contains for each parameter the real
                 chi^2 value at the bounds, to enable checking of
                 the precision of the bounds.
Output Parameters
           a 2 dimensional array containing the error ranges for all
           fit parameters (lower boundary = upper boundary for the
           fixed parameters).
Optional Output

Restrictions

Procedure
           a not very stable combination of a secant method and bisection
Example

Revision History
     based on fiterror.pro, written by Joern Wilms on 1999.10.21,
     based on previous work by JW and Mike Nowak, and subsequent
     corrections.
     CVS Version 1.0, 2001.12.06, Joern Wilms
         (mainly written while at SSO in October 2001)

Last modified by pro2html on 2005 January 04 at 16:36 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms ([email protected])
Updated automatically