TENSION

Syntax: SET TENSION n
GET TENSION { n }
Default: TENSION = 0.0

TENSION controls the spline tension for the functions using cubic splines:

DERIV, INTEGRAL, INTERPOLATE, SMOOTH, and SPLINTERP

.

Definition

The value of TENSION corresponds to the "curviness" of the resultant spline function. TENSION must be ≥ 0.

If TENSION is set to zero, the result will be an interpolating cubic spline.

If TENSION is large, the result will be the least-squares line through the data.

As TENSION decreases, the amount of smoothing decreases and the data points are fit more exactly.

As TENSION increases, the fit straightens and has less curvature at peaks, valleys and endpoints.

Suppose that N is the length of vector y and that the weights are the standard deviations of y. Values of tension TENSION in the range    N-sqrt(2N) ≤ TENSION ≤ N+sqrt(2N)    give the most natural looking results. To obtain the most suitable fit, the user may wish to do several runs with different values of TENSION. By observing the results of the spline fits, the most suitable value for TENSION can be selected.

Method

Given a set of abscissae: , a cubic spline function over the region  is composed of cubic parabolas

where , which join at the endpoints    such that , , and are continuous.

The smoothing function is constructed by minimizing

subject to the constraint

where    are the weights and    is the spline tension.

The solution proceeds by the standard methods of minimizing the functional

where    and    are auxiliary parameters. The functional is minimized with respect to    and    by setting the partial derivatives with respect to    and    equal to zero.

  NHISTORY
  AUTOSCALE