FITCURVE

Fit a curve to the data

Description:

This command fits data using either a polynomial or a smooth spline. If weights are available these can be used when determining the fit.

The resultant fit parameters are displayed and written to the environment for use by the PLOTFUN application, which can re-plot the polynomial or spline with other datasets etc. 

Usage:

fitcurve action npoly [weight]

Parameters:

ACTION = _CHAR (Read and Write)
Type of curve to be fitted. Currently this action must be "POLY" or "SPLINE"

If the parameter is not specified on the command line, it will be prompted for.

NPOLY = _INTEGER (Read and Write)
The order of the polynomial or spline. For polynomials this can range from 1 to 9 and for splines from 2 to 6.

If the parameter is not specified on the command line, it will be prompted for.

COLOUR = _INTEGER (Read and Write)
The colour index used when plotting the fitted curve.

If no value is specified on the command line, the current value is used. If there is no current value, a default of 2 (i.e. red) will be used.

WEIGHT = _LOGICAL (Read and Write)
Whether the fit is to use the y-axis error data in the EYCOL data area, if available. If no error data are available, the fit will always be unweighted.

If the value is not specified on the command line, the current value is used. If there is no current value, a default value of TRUE is used.

POLYCOEF[10] = _DOUBLE (Write)
If ACTION is "POLY", the polynomial coefficients resulting from the fit are written to this parameter.

The value of this parameter is written to the global parameter PONGO_POLYCOEF.

POLYFILE = _CHAR (Read)
The name of a file to contain the polynomials coefficients of the fit (only used ACTION is "POLY"). This file can be used to store the fit permanently and can be used by the PLOTFUN command to redraw the fit.

[POLYFILE.dat]

SMOOTH = _REAL (Read)
Only used if ACTION is "SPLINE". This factor determines the tradeoff between the closeness and smoothness of the spline fit. It should be a real number greater than 0.0. Normally this is dynamically defaulted to a number equal to the number of points to be fitted. Decreasing this value to 0.0 produces an interpolating spline fit.
SPLINEFILE = _CHAR (Read)
The name of a file to contain the coefficients and knot positions from the spline fit – used when ACTION is "SPLINE". This file can be used by the PLOTFUN command to redraw the fit.

[The value of the global parameter PONGO_SPLINEF is used. If PONGO_SPLINEF is not defined, the value is prompted for.]

XMIN = _REAL (Read)
The minimum X value to be used in the fit.

The value of the global parameter PONGO_XMIN is used. If PONGO_XMIN is not defined, the default value 0.0 is used.

XMAX = _REAL (Read)
The maximum X value to be used in the fit.

The value of the global parameter PONGO_XMAX is used. If PONGO_XMAX is not defined, the default value 1.0 is used.

Notes: