c_ftcurvs(3NCARG) | NCAR GRAPHICS | c_ftcurvs(3NCARG) |
c_ftcurvs - compute a smoothing spline
int c_ftcurvs (int, float [], float [], int, float [], int, float [], float []);
int c_ftcurvs (n, xi, yi, dflg, d, m, xo, yo);
c_ftcurvs returns an error value as per:
= 1 if n is less than 2.
= 2 if smt is negative.
= 3 if eps is negative or greater than 1.
= 4 if x values are not strictly increasing.
= 5 if d is negative.
This function computes an interpolatory smoothing spline under tension through a sequence of functional values.
Two parameters and one function argument used to control the degree of smoothness -- the parameters are smt, and eps and the function argument is d.
The argument d is a value indicating the degree of confidence in the accuracy of the input function values -- it should be an approximation of the standard deviation of error. Effectively the value of d controls how close the smoothed curve comes to the input data points. If d is small, then the interpolated curve will pass close to the input data. The larger the value of d, the more freedom the smooth curve has in how close it comes to the input data values.
The parameter smt is a more subtle global smoothing parameter; smt must be non-negative. For small values of smt, the curve approximates the tension spline and for larger values of smt, the curve is smoother. A reasonable value for smt is (float) n.
The parameter eps controls the precision to which smt is interpreted; eps must be between 0. and 1. inclusive. A reasonable value for eps sqrt( 2./(float) n ).
c_ftcurvs is called after all of the desired values for control parameters have been set using the procedures c_ftseti, c_ftsetr, c_ftsetc. Control parameters that apply to c_ftcurvs are: sig, smt, eps, sf2.
The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 50) result in nearly a polygonal line. A typical value is 1. (the default).
To use c_ftcurvs, load the NCAR Graphics library ngmath.
fitgrid_params, c_ftseti, c_ftsetr, c_ftsetc.
Complete documentation for Fitgrid is available at URL
http://ngwww.ucar.edu/ngdoc/ng/ngmath/fitgrid/fithome.html
Copyright (C) 2000
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
March 1998 | UNIX |