|
Next: Parameter Uncertainties Up: Fitting Previous: Errors
FittingThis section requires the DEMO1.QDP file described in the previous section. Before you can fit data, you must first define a model. First, read in the data and define a constant model with $ QDP DEMO1 (enter device type) PLT> MOdel CONSAt this point, you will be prompted for the default initial value for the constant. Enter to use the default, and at the PLT> prompt, type Fit.
When Fit runs, it first tells you which plot group is being fitted
and the range over which data are being fitted.
It is important to realize that if you have used R X to rescale the x-axis so that some
points are outside the range plotted,
then these points would not be included in the fit.
You cannot exclude points using the R Y command.
(This is intended to prevent cheating.)
You will next see the message ``Fitting 5 points in a band of 5''.
This informs you that there are 5 points in the current x-range.
In order to execute faster,
the FIT routine resets the minimum and maximum of the array,
to achieve the smallest range possible that includes all points
in the x-range,
and so the ``band of 5'' output informs you
how big this minimum range is.
Next the FIT routine prints the current parameter values
(1.00000 in this case).
The program then prints the current value
of the weighted variance W-VAR.
If you have errors on your data,
the weighted variance is c2;
for no errors, W-VAR is just the variance.
The number in () is log l
and is for the expert's use.
The CURFIT routine will terminate when the change in c2
or, for an unweighted fit the relative change in the variance, is
less than 0.05.
If this condition has not been met after 10 iterations,
you will be prompted ``Continue fitting? (n)''.
Answer Y to continue or N to terminate.
If you are are fitting in background or batch mode,
then you should always leave a blank line after the For the above, the total variance is 18323 and hence a CONS does not look like a very good model. Let's try a more complicated model with PLT> MOdel CO LI QUto include constant, linear and quadratic components. Again you can default on all the initial values. When you type Fit, you should find that W-VAR has decreased to 4.23. This is clearly a better fit.
To generate a list of all possible built-in components,
use the MOdel ? command.
To get a description of what a component does,
use the HElp MOdel command followed by the component name.
If you can not construct your model from the built-in components,
then you can create additional components.
A COD file can be used to define a sophisticated component.
COD files are ASCII text files that contain functions
written in a Forth-like computer language.
Chapter 7 and Appendix A describe COD in some detail.
If your component is too complicated for COD,
or you don't like using COD,
then you can create a Fortran function that can be used as a new component.
The next chapter will describe how to create this function UFNY,
and the supporting routines to replace the built-in It is possible to save the current model to a disk file using the WModel command. For example, PLT> WModel DEMO1will create a DEMO1.MOD file. To read this model back into PLT use the command MOdel @DEMO1. Model files can be printed out to make a hardcopy of the current parameter values. If you do not enter a file name with the WModel command, then the model is written to your current terminal screen.
Next: Parameter Uncertainties Up: Fitting Previous: Errors
Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov |