1 #ifndef SimTK_SIMMATH_SPLINE_FITTER_H_
2 #define SimTK_SIMMATH_SPLINE_FITTER_H_
98 degree, 2, 0, coeff, wk, ier);
100 (degree,
Spline_<T>(degree, x, coeff), wk[3], wk[4], wk[2]));
117 degree, 3, error, coeff, wk, ier);
119 (degree,
Spline_<T>(degree, x, coeff), wk[3], wk[4], wk[2]));
136 degree, 4, dof, coeff, wk, ier);
138 (degree,
Spline_<T>(degree, x, coeff), wk[3], wk[4], wk[2]));
155 degree, 1, p, coeff, wk, ier);
157 (degree,
Spline_<T>(degree, x, coeff), wk[3], wk[4], wk[2]));
184 class SplineFitterImpl;
187 SplineFitterImpl* impl;
196 assert(referenceCount == 0);
206 #endif // SimTK_SIMMATH_SPLINE_FITTER_H_
Real error
Definition: SplineFitter.h:201
Real dof
Definition: SplineFitter.h:201
static SplineFitter fitFromErrorVariance(int degree, const Vector &x, const Vector_< T > &y, Real error)
Perform a fit, choosing a value of the smoothing parameter based on the known error variance in the d...
Definition: SplineFitter.h:112
static SplineFitter fitFromDOF(int degree, const Vector &x, const Vector_< T > &y, Real dof)
Perform a fit, choosing a value of the smoothing parameter based on the expect number of degrees of f...
Definition: SplineFitter.h:131
Real p
Definition: SplineFitter.h:201
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
int size() const
Definition: VectorBase.h:396
SplineFitterImpl(int degree, const Spline_< T > &spline, Real p, Real error, Real dof)
Definition: SplineFitter.h:193
~SplineFitter()
Definition: SplineFitter.h:79
static SplineFitter fitFromGCV(int degree, const Vector &x, const Vector_< T > &y)
Perform a fit, choosing a value of the smoothing parameter that minimizes the Generalized Cross Valid...
Definition: SplineFitter.h:93
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:577
SplineFitter operator=(const SplineFitter ©)
Definition: SplineFitter.h:74
Real getDegreesOfFreedom()
Get the estimate of the number of degrees of freedom of the residual that was determined by the fitti...
Definition: SplineFitter.h:180
SplineFitter(const SplineFitter ©)
Definition: SplineFitter.h:71
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
Given a set of data points, this class creates a Spline_ which interpolates or approximates them...
Definition: SplineFitter.h:69
~SplineFitterImpl()
Definition: SplineFitter.h:195
Definition: SplineFitter.h:191
const Spline_< T > & getSpline()
Get the Spline_ that was generated by the fitting.
Definition: SplineFitter.h:162
Spline_< T > spline
Definition: SplineFitter.h:200
int degree
Definition: SplineFitter.h:199
This is the header file that every Simmath compilation unit should include first. ...
int referenceCount
Definition: SplineFitter.h:198
This class implements a non-uniform Bezier curve.
Definition: Spline.h:52
static SplineFitter fitForSmoothingParameter(int degree, const Vector &x, const Vector_< T > &y, Real p)
Perform a fit, using a specified fixed value for the smoothing parameter.
Definition: SplineFitter.h:150
Vector_< Real > Vector
Variable-size column vector of Real elements; abbreviation for Vector_.
Definition: BigMatrix.h:1473
void copy(Row< 1, E1, S1 > &r1, const Row< 1, E2, S2 > &r2)
Definition: Row.h:105
static void gcvspl(const Vector &x, const Vector &y, const Vector &wx, Real wy, int m, int md, Real val, Vector &c, Vector &wk, int &ier)
Real getSmoothingParameter()
Get the smoothing parameter that was used for the fitting.
Definition: SplineFitter.h:168
Real getMeanSquaredError()
Get the estimate of the true mean squared error in the data that was determined by the fitting...
Definition: SplineFitter.h:174