STK++ 0.9.13
|
Compute the regression splines coefficients of an additive model. More...
#include <STK_AdditiveBSplineCoefficients.h>
Public Types | |
typedef hidden::Traits< Array >::Row | RowVector |
typedef hidden::Traits< Array >::Col | ColVector |
Public Member Functions | |
AdditiveBSplineCoefficients (Array const *p_data, int nbControlPoints, int degree=3, Regress::KnotsPosition position=Regress::uniformKnotsPositions_) | |
Constructor : initialize the data members. | |
AdditiveBSplineCoefficients (Array const &data, int nbControlPoints, int degree=3, Regress::KnotsPosition position=Regress::uniformKnotsPositions_) | |
Constructor : initialize the data members. | |
AdditiveBSplineCoefficients (AdditiveBSplineCoefficients const &coefs) | |
Copy constructor. | |
virtual | ~AdditiveBSplineCoefficients () |
Destructor. | |
AdditiveBSplineCoefficients * | clone () const |
clone pattern implementation | |
void | setData (Array const *p_data, int nbControlPoints, int degree=3, Regress::KnotsPosition position=Regress::uniformKnotsPositions_) |
Compute the coefficients of the B-spline curve for the given values. | |
bool | run () |
run the computations. | |
int | degree () const |
give the degree of the B-spline curves. | |
int | nbKnots () const |
give the number of knots of the B-spline curves. | |
int | nbControlPoints () const |
give the number of control points of the B-spline curves. | |
ArrayXX const & | coefficients () const |
give the computed coefficients of the B-spline curves. | |
ArrayXX | extrapolate (Array const &x) const |
![]() | |
String const & | error () const |
get the last error message. | |
Protected Attributes | |
Array const * | p_data_ |
the input data set | |
int | nbKnots_ |
number of knots of the B-spline curves. | |
int | nbControlPoints_ |
number of control points of the B-spline curves. | |
int | degree_ |
degree of the B-splines curves. | |
Regress::KnotsPosition | position_ |
Method used in order to position the knots. | |
Array1D< BSplineCoefficients< ColVector > > | coefs_ |
Array with the knots and coefficients in each dimension. | |
ArrayXX | coefficients_ |
Array of the coefficients. | |
![]() | |
String | msg_error_ |
String with the last error message. | |
bool | hasRun_ |
true if run has been used, false otherwise | |
Additional Inherited Members | |
![]() | |
IRunnerBase () | |
default constructor | |
IRunnerBase (IRunnerBase const &runner) | |
copy constructor | |
virtual | ~IRunnerBase () |
destructor | |
virtual void | update () |
update the runner. | |
Compute the regression splines coefficients of an additive model.
The method is described in BSplineCoefficients documentation class and repeated for each variables of the model. The number of control points, the degree and the position of the knots are the same for all variables.
If the input data set is a matrix of size (n,p) then the output matrix of the coefficients Coefficients()
is a matrix of size (n, p*nbControlPoints) where p is the number of variables.
Definition at line 56 of file STK_AdditiveBSplineCoefficients.h.
typedef hidden::Traits<Array>::Col STK::AdditiveBSplineCoefficients< Array >::ColVector |
Definition at line 60 of file STK_AdditiveBSplineCoefficients.h.
typedef hidden::Traits<Array>::Row STK::AdditiveBSplineCoefficients< Array >::RowVector |
Definition at line 59 of file STK_AdditiveBSplineCoefficients.h.
|
inline |
Constructor : initialize the data members.
The number of knots is given by the formula nbKnots = nbControlPoints + degree +1.
p_data | a pointer on the input data values |
nbControlPoints | number of control points |
degree | degree of the B-spline curves |
position | method to use for positioning the knots |
Definition at line 68 of file STK_AdditiveBSplineCoefficients.h.
|
inline |
Constructor : initialize the data members.
The number of knots is given by the formula nbKnots = nbControlPoints + degree +1.
data | the input data values |
nbControlPoints | number of control points |
degree | degree of the B-spline curves |
position | method to use for positioning the knots |
Definition at line 88 of file STK_AdditiveBSplineCoefficients.h.
|
inline |
Copy constructor.
coefs | the coefficients to copy |
Definition at line 104 of file STK_AdditiveBSplineCoefficients.h.
|
inlinevirtual |
|
inline |
clone pattern implementation
Definition at line 116 of file STK_AdditiveBSplineCoefficients.h.
|
inline |
give the computed coefficients of the B-spline curves.
This is a matrix of size (p_data_->range(), 0:lastControlPoints).
Definition at line 141 of file STK_AdditiveBSplineCoefficients.h.
References STK::AdditiveBSplineCoefficients< Array >::coefficients_.
Referenced by STK::AdditiveBSplineRegression< YArray, XArray, Weights >::coefficients().
|
inline |
give the degree of the B-spline curves.
Definition at line 133 of file STK_AdditiveBSplineCoefficients.h.
References STK::AdditiveBSplineCoefficients< Array >::degree_.
ArrayXX STK::AdditiveBSplineCoefficients< Array >::extrapolate | ( | Array const & | x | ) | const |
x | the values to extrapolate |
Definition at line 216 of file STK_AdditiveBSplineCoefficients.h.
References _T, STK::MultidimRegression< Array, Weight >::coefs_, STK::MultidimRegression< Array, Weight >::extrapolate(), STK::IArray2D< Derived >::merge(), stk_cout, and STKRUNTIME_ERROR_NO_ARG.
|
inline |
give the number of control points of the B-spline curves.
Definition at line 137 of file STK_AdditiveBSplineCoefficients.h.
References STK::AdditiveBSplineCoefficients< Array >::nbControlPoints_.
|
inline |
give the number of knots of the B-spline curves.
Definition at line 135 of file STK_AdditiveBSplineCoefficients.h.
References STK::AdditiveBSplineCoefficients< Array >::nbKnots_.
|
virtual |
run the computations.
Implements STK::IRunnerBase.
Definition at line 166 of file STK_AdditiveBSplineCoefficients.h.
References _T, STK::IArray2D< Derived >::clear(), STK::MultidimRegression< Array, Weight >::coefs_, STK::IRunnerBase::error(), STK::IArray2D< Derived >::merge(), STK::IRunnerBase::msg_error_, STK::IArray2D< Derived >::resize(), STK::AdditiveBSplineCoefficients< Array >::run(), STK::IRegression< Array, Array, Weight >::run(), stk_cout, and STKERROR_NO_ARG.
Referenced by STK::AdditiveBSplineCoefficients< Array >::run().
void STK::AdditiveBSplineCoefficients< Array >::setData | ( | Array const * | p_data, |
int | nbControlPoints, | ||
int | degree = 3 , |
||
Regress::KnotsPosition | position = Regress::uniformKnotsPositions_ |
||
) |
Compute the coefficients of the B-spline curve for the given values.
p_data | the input data values |
nbControlPoints | number of control points |
degree | degree of the B-spline curves |
position | method to use for positioning the knots |
Definition at line 241 of file STK_AdditiveBSplineCoefficients.h.
|
protected |
Array of the coefficients.
Definition at line 161 of file STK_AdditiveBSplineCoefficients.h.
Referenced by STK::AdditiveBSplineCoefficients< Array >::coefficients().
|
protected |
Array with the knots and coefficients in each dimension.
Definition at line 159 of file STK_AdditiveBSplineCoefficients.h.
|
protected |
degree of the B-splines curves.
Definition at line 155 of file STK_AdditiveBSplineCoefficients.h.
Referenced by STK::AdditiveBSplineCoefficients< Array >::degree().
|
protected |
number of control points of the B-spline curves.
Definition at line 153 of file STK_AdditiveBSplineCoefficients.h.
Referenced by STK::AdditiveBSplineCoefficients< Array >::nbControlPoints().
|
protected |
number of knots of the B-spline curves.
Definition at line 151 of file STK_AdditiveBSplineCoefficients.h.
Referenced by STK::AdditiveBSplineCoefficients< Array >::nbKnots().
|
protected |
the input data set
Definition at line 149 of file STK_AdditiveBSplineCoefficients.h.
|
protected |
Method used in order to position the knots.
Definition at line 157 of file STK_AdditiveBSplineCoefficients.h.