Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
steppar
plot 1D or 2D chi^2 contours for chi^2 fitting error determination
fitting
steppar,x,y,w,a plus lot's of keywords
x,y,w: (x,y) values and weight of data, identical to curvefit a: best fit parameters of the fit function
* 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.
par1val: values of 1st parameter par2val: values of 2nd parameter chi2val: array containing the chi^2 values
none
if /plot is set, a (contour) plot is drawn in the current window
stepping regions need to contain the best fit value.
(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
Version 1.0, 1999/03/03, Joern Wilms ([email protected]) 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
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]