[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

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


steppar Source code in steppar.pro

steppar

Name
       steppar
Purpose
       plot 1D or 2D chi^2 contours for chi^2 fitting error determination
Category
       fitting
Calling Sequence
       steppar,x,y,w,a plus lot's of keywords
Input Parameters
       x,y,w: (x,y) values and weight of data, identical to
              curvefit
       a: best fit parameters of the fit function
Optional Input Parameters

Keyword Parameters
     * required:
         par1ind: index of 1st parameter to be stepped
         par1min,par1max: min. and max. value of 1st parameter
         nstep1: number of steps for par1
     * optional:
         par1log: if set, use logarithmic steps
         par2ind,par2min,par2max,nstep2,par2log: same as
            the ..1.. pars for the 2nd parameter to be stepped.
         chi2red: reduced chi^2 at minimum (result from chi2 keyword
                of curvefit)
         dof: degrees of freedom (returned from curvefit)
         plot: if set, a plot of chi^2 vs. the parameter(s) is
            shown, with contours indicating the 1sigma, 90%, and 99%
            confidence regions (the latter option requires the
            chi2red and dof values as well!).
         sigmaa: if also given (returnvalue from jwcurvefit) also
            plot the error bars as determined from the Hessian
            matrix (also need chi2red and dof).
         dev: plot axes as deviation from best fit value
       * All keyword-parameters given to the previous call to
         curvefit.
Output Parameters

Optional Output
       par1val: values of 1st parameter
       par2val: values of 2nd parameter
       chi2val: array containing the chi^2 values
Common Blocks
       none
Side Effects
       if /plot is set, a (contour) plot is drawn in the current window
Restrictions
       stepping regions need to contain the best fit value.
Procedure

Example
   (from a program doing a fit to an astrophysical absorption line)
   bounds=[ $
            [0.,10000.], $
            [xstart,xend], $
            [0.,20.], $
            [0.,10.], $
            [0.,0.] $
          ]
   ;; do the fit
   res=jwcurvefit(lam,dat,w,a,sigmaa,function_name='hbetaline',/noderivative, $
                  chi2=chi2,itmax=200,tol=1D-5,iter=iter,bounds=bounds, $
                 dof=doffit)
   steppar,lam,dat,w,a,$
     par1ind=1,par1min=a[1]-2.,par1max=a[1]+2.,nstep1=30, $
     par2ind=2,par2min=a[2]-0.75,par2max=a[2]+0.75,nstep2=30, $
     par1val=par1val,par2val=par2val,chi2val=chi2val,$
     chi2red=chifit,dof=doffit,$
     FUNCTION_name='hbetaline',/noderivative,bounds=bounds,/plot
Revision History
     Version 1.0, 1999/03/03, Joern Wilms (wilms@astro.uni-tuebingen.de)
     Version 1.1, 1999/11, 23, JW:
         added psym plotting option,
         removed bug in computation of fit uncertainty (dof was
            overwritten)
         added option to also plot uncertainty from Hessian matrix

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

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

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically