Click or drag to resize
BsLeastSquares Class
Extension of the BSpline class to compute a least squares spline approximation to data points.
Inheritance Hierarchy

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class BsLeastSquares : BSpline

The BsLeastSquares type exposes the following members.

Constructors
Methods
  NameDescription
Public methodDerivative(Double)
Returns the value of the first derivative of the B-spline at a point.
(Inherited from BSpline.)
Public methodDerivative(Double, Int32)
Returns the value of the derivative of the B-spline at a point.
(Inherited from BSpline.)
Public methodDerivative(Double, Int32)
Returns the value of the derivative of the B-spline at each point of an array.
(Inherited from BSpline.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEval(Double)
Returns the value of the B-spline at a point.
(Inherited from BSpline.)
Public methodEval(Double)
Returns the value of the B-spline at each point of an array.
(Inherited from BSpline.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKnots
Returns a copy of the knot sequence.
(Inherited from BSpline.)
Public methodGetSpline
Returns a Spline representation of the B-spline.
(Inherited from BSpline.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIntegral
Returns the value of an integral of the B-spline.
(Inherited from BSpline.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Let's make the identifications

n = xData.Length

x = xData

f = yData

m = nCoef

k = order

For convenience, we assume that the sequence x is increasing, although the class does not require this.

By default, k = 4, and the knot sequence we select equally distributes the knots through the distinct {x_i}'s. In particular, the m + k knots will be generated in [x_1, x_n] with k knots stacked at each of the extreme values. The interior knots will be equally spaced in the interval.

Once knots {\bf t} and weights w are determined, then the spline least-squares fit to the data is computed by minimizing over the linear coefficients a_j

\sum_{i=0}^{n-1} 
            {w_i\biggl[f_i-\sum_{j=1}^{m}{a_jB_j(x_i)}\biggr]^2}

where the B_j, j = 1, ..., m are a (B-spline) basis for the spline subspace.

This algorithm is based on the routine L2APPR by deBoor (1978, p. 255).

See Also

Reference

Other Resources