Click or drag to resize
Spline2DLeastSquares Class
Computes a two-dimensional, tensor-product spline approximant using least squares.
Inheritance Hierarchy

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

The Spline2DLeastSquares type exposes the following members.

Constructors
  NameDescription
Public methodSpline2DLeastSquares
Constructor for Spline2DLeastSquares.
Top
Methods
  NameDescription
Public methodCompute
Computes a two-dimensional, tensor-product spline approximant using least squares.
Public methodDerivative(Double, Double, Int32, Int32)
Returns the value of the partial derivative of the tensor-product spline at the point (x, y).
(Inherited from Spline2D.)
Public methodDerivative(Double, Double, Int32, Int32)
Returns the values of the partial derivative of the tensor-product spline of an array of points.
(Inherited from Spline2D.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
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 methodGetCoefficients
Returns the coefficients for the tensor-product spline.
(Inherited from Spline2D.)
Public methodGetErrorSumOfSquares
Returns the weighted error sum of squares.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetXKnots
Returns the knot sequences in the x-direction.
(Inherited from Spline2D.)
Public methodGetXOrder
Returns the order of the spline in the x-direction.
Public methodGetXWeights
Returns the weights for the least-squares fit in the x-direction.
Public methodGetYKnots
Returns the knot sequences in the y-direction.
(Inherited from Spline2D.)
Public methodGetYOrder
Returns the order of the spline in the y-direction.
Public methodGetYWeights
Returns the weights for the least-squares fit in the y-direction.
Public methodIntegral
Returns the value of an integral of a tensor-product spline on a rectangular domain.
(Inherited from Spline2D.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetXKnots
Sets the knot sequences of the spline in the x-direction.
Public methodSetXOrder
Sets the order of the spline in the x-direction.
Public methodSetXWeights
Sets the weights for the least-squares fit in the x-direction.
Public methodSetYKnots
Sets the knot sequences of the spline in the y-direction.
Public methodSetYOrder
Sets the order of the spline in the y-direction.
Public methodSetYWeights
Sets the weights for the least-squares fit in the y-direction.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValue(Double, Double)
Returns the value of the tensor-product spline at the point (x, y).
(Inherited from Spline2D.)
Public methodValue(Double, Double)
Returns the values of the tensor-product spline of an array of points.
(Inherited from Spline2D.)
Top
Remarks

The Spline2DLeastSquares class computes a tensor-product spline least-squares approximation to weighted tensor-product data. The input consists of data vectors to specify the tensor-product grid for the data, two vectors with the weights, the values of the surface on the grid, and the specification for the tensor-product spline. The grid is specified by the two vectors x = xData and y = yData of length
n = xData.Length and m = yData.Length, respectively. A two-dimensional array f = fData contains the data values which are to be fit. The two vectors w_x = xWeights and w_y = yWeights contain the weights for the weighted least-squares problem. The information for the approximating tensor-product spline can be provided using the SetXOrder, SetYOrder, SetXKnots and SetYKnots methods. This information is contained in k_x = xOrder, t_x = xKnots, and N = xSplineSpaceDim for the spline in the first variable, and in k_y = yOrder, t_y = yKnots and M = ySplineSpaceDim for the spline in the second variable. This class computes coefficients for the tensor-product spline by solving the normal equations in tensor-product form as discussed in de Boor (1978, Chapter 17). The interested reader might also want to study the paper by Grosse (1980).

As the computation proceeds, we obtain coefficients c minimizing

\sum\limits_{i = 0}^{n - 1} {\sum\limits_{j = 0}^{m - 1} {w_x \left( i \right)w_y \left( j \right)} \left[ {\sum\limits_{k = 0}^{N - 1} {\sum\limits_{l = 0}^{M - 1} {c_{kl} } B_{kl} \left( {x_i ,y_i } \right) - f_{ij} } } \right]} ^2
where the function B_{kl} is the tensor-product of two B-splines of order k_x and k_y. Specifically, we have
B_{kl} \left( {x,y} \right) = B_{k,k_x ,t_x } \left( x \right)B_{l,k_y ,t_y } \left( y \right)
The spline
\sum\limits_{k = 0}^{N - 1} {\sum\limits_{l = 0}^{M - 1} {c_{kl} } } B_{kl}
and its partial derivatives can be evaluated using the Value method.

See Also

Reference

Other Resources