NMath Reference Guide

## Smooth |

Class SmoothCubicSpline calculates smoothing splines.

Inheritance Hierarchy

SystemObject

CenterSpace.NMath.CoreOneVariableFunction

CenterSpace.NMath.CoreTabulatedFunction

CenterSpace.NMath.CoreSmoothCubicSpline

CenterSpace.NMath.CoreOneVariableFunction

CenterSpace.NMath.CoreTabulatedFunction

CenterSpace.NMath.CoreSmoothCubicSpline

Syntax

The SmoothCubicSpline type exposes the following members.

Constructors

Name | Description | |
---|---|---|

SmoothCubicSpline | Used for cloning. | |

SmoothCubicSpline(DoubleVector, DoubleVector, Double, DoubleVector) | Constructs a smooth cubic spline object for interpolation within the given data points. |

Properties

Name | Description | |
---|---|---|

Differentiator |
Gets and sets the differentiation method object associated with this function.
(Inherited from OneVariableFunction) | |

Func |
Gets the function encapsulated by this object.
(Inherited from OneVariableFunction) | |

Integrator |
Gets and sets the integration method object associated with this function.
(Inherited from OneVariableFunction) | |

NumberOfTabulatedValues |
Gets the number of tabulated values.
(Inherited from TabulatedFunction) | |

P | Gets and set the smoothing factor P. P determines how much weight is given to minimizing the sum square error balanced against minimizing the curvature. When p = 1 the result is a traditional cubic spline. When p = 0 the result is a straight line ( zero curvature ). |

Methods

Name | Description | |
---|---|---|

Clone |
Creates a deep copy.
(Overrides OneVariableFunctionClone) | |

Derivative |
Returns the first derivative of this function.
(Inherited from OneVariableFunction) | |

Differentiate |
Computes the numerical derivative of the current function at the given
x-value.
(Inherited from OneVariableFunction) | |

Evaluate(Double) |
Evaluates the current function at the given x-value.
(Inherited from OneVariableFunction) | |

Evaluate(DoubleVector) |
Evaluates the current function at the given set of x-values.
(Inherited from OneVariableFunction) | |

Evaluate(OneVariableFunction) |
Creates a composite function.
(Inherited from OneVariableFunction) | |

GetX |
Returns the value of the tabulated independent values at the specified
index.
(Inherited from TabulatedFunction) | |

GetXs |
Gets the x, or independent, values represented by this function.
(Inherited from TabulatedFunction) | |

GetXVector |
Gets the x, or independent, values represented by this function.
(Inherited from TabulatedFunction) | |

GetY |
Returns the value of the tabulated dependent values at the specified
index.
(Inherited from TabulatedFunction) | |

GetYs |
Gets the y, or dependent, values represented by this function.
(Inherited from TabulatedFunction) | |

GetYVector |
Gets the y, or dependent, values represented by this function.
(Inherited from TabulatedFunction) | |

Integrate |
Computes the integral of the current function over the specified
interval.
(Inherited from OneVariableFunction) | |

ProcessTabulatedValues |
Computes the smooth cubic spline for this instance.
(Overrides TabulatedFunctionProcessTabulatedValues) | |

SetTabulatedValues(DoubleVector, DoubleVector) |
Changes the values of the tabulated function.
(Inherited from TabulatedFunction) | |

SetTabulatedValues(Int32, Double, Double) |
Set the values of the tabulated point at the specified index to the
specified value.
(Inherited from TabulatedFunction) | |

SetTabulatedValues(Range, DoubleVector, DoubleVector) |
Sets the the tabulated point values in the specifed range to the
specified values.
(Inherited from TabulatedFunction) | |

SetX(Int32, Double) |
Sets the value of the independent tabulated value at the specified
index to the specified value.
(Inherited from TabulatedFunction) | |

SetX(Range, DoubleVector) |
Sets the the tabulated independent values in the specifed range to the
specified values.
(Inherited from TabulatedFunction) | |

SetY(Int32, Double) |
Sets the value of the dependent tabulated value at the specified
index to the specified value.
(Inherited from TabulatedFunction) | |

SetY(Range, DoubleVector) |
Sets the the tabulated dependent values in the specifed range to the
specified values.
(Inherited from TabulatedFunction) |

Fields

Name | Description | |
---|---|---|

differentiator_ | Differentiator (Inherited from OneVariableFunction) | |

function_ | Captured function (Inherited from OneVariableFunction) | |

integrator_ | Integrator (Inherited from OneVariableFunction) | |

xi_ |
Tabulated independent function values.
(Inherited from TabulatedFunction) | |

yi_ |
Tabulated dependent function values.
(Inherited from TabulatedFunction) |

Remarks

Gives the approximate values
y[i] = g(x[i]) + e(i)
of a function g and error e, the smoothing spline tries to recover
the function g by constructing a function f that minimizes the sum
square error and curvature:
p*sum(y[i] - f(x[i])^2/dy[i] + (1-p)*int[(f'')^2]
where p is a smoothing factor between 1 and 0, dy[i] is the variance
in each y[i] (defaults to 1 if not specified), and int stands for
integration. The first term in the above expression is the sum squared
error of the approximating function f, and the second term is its
curvature. The smoothing factor, p, determines how much weight is
given to minimizing the sum square error balanced against minimizing
the curvature. When p = 1 only the sum square error is minimized and
the result is a traditional cubic spline. When p = 0 only the curvature
is minimized and the result is a straight line which has 0 curvature.

See Also