36#ifndef STK_ADDITIVEBSPLINECOEFFICIENTS_H
37#define STK_ADDITIVEBSPLINECOEFFICIENTS_H
168#ifdef STK_REGRESS_VERBOSE
169 stk_cout <<
_T(
"In AdditiveBSplineCoefficients::run()\n");
184 coefficients_.resize(p_data_->rows(),
Range());
186 for (
int i=p_data_->beginCols();
i<p_data_->endCols();
i++)
208#ifdef STK_REGRESS_VERBOSE
209 stk_cout <<
_T(
"AdditiveBSplineCoefficients::run() done\n");
218#ifdef STK_REGRESS_VERBOSE
219 stk_cout <<
_T(
"in AdditiveBSplineCoefficients::extrapolate()\n");
221 if (x.cols() !=
coefs_.range())
227#ifdef STK_REGRESS_VERBOSE
228 stk_cout <<
_T(
"AdditiveBSplineCoefficients::run() done\n");
242 ,
int nbControlPoints
248 nbKnots_ = nbControlPoints + degree +1;
249 nbControlPoints_ = nbControlPoints;
In this file we define the BSplineCoefficients class.
#define STKERROR_NO_ARG(Where, Error)
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Compute the regression splines coefficients of an additive model.
virtual ~AdditiveBSplineCoefficients()
Destructor.
AdditiveBSplineCoefficients * clone() const
clone pattern implementation
int degree() const
give the degree of the B-spline curves.
ArrayXX const & coefficients() const
give the computed coefficients of the B-spline curves.
hidden::Traits< Array >::Row RowVector
ArrayXX coefficients_
Array of the coefficients.
Regress::KnotsPosition position_
Method used in order to position the knots.
AdditiveBSplineCoefficients(Array const *p_data, int nbControlPoints, int degree=3, Regress::KnotsPosition position=Regress::uniformKnotsPositions_)
Constructor : initialize the data members.
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.
hidden::Traits< Array >::Col ColVector
int nbControlPoints_
number of control points of the B-spline curves.
Array1D< BSplineCoefficients< ColVector > > coefs_
Array with the knots and coefficients in each dimension.
bool run()
run the computations.
int nbKnots() const
give the number of knots of the B-spline curves.
ArrayXX extrapolate(Array const &x) const
int degree_
degree of the B-splines curves.
AdditiveBSplineCoefficients(Array const &data, int nbControlPoints, int degree=3, Regress::KnotsPosition position=Regress::uniformKnotsPositions_)
Constructor : initialize the data members.
Array const * p_data_
the input data set
int nbKnots_
number of knots of the B-spline curves.
AdditiveBSplineCoefficients(AdditiveBSplineCoefficients const &coefs)
Copy constructor.
int nbControlPoints() const
give the number of control points of the B-spline curves.
Sdk class for all library Exceptions.
Derived & resize(Range const &I, Range const &J)
resize the array.
void merge(IArray2D< OtherDerived > const &other)
Append the container other to this without copying the data explicitly.
void clear()
clear the object.
virtual bool run()
run the computations.
Abstract base class for all classes having a.
String msg_error_
String with the last error message.
String const & error() const
get the last error message.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
virtual Array extrapolate(Array const &x) const
Index sub-vector region: Specialization when the size is unknown.
KnotsPosition
Method to use for positioning the knots for BSpline basis.
@ uniformKnotsPositions_
uniform knots
The namespace STK is the main domain space of the Statistical ToolKit project.