B-spline model for transformations. More...
#include <OpenMS/ANALYSIS/MAPMATCHING/TransformationModel.h>
Public Member Functions | |
| TransformationModelBSpline (const DataPoints &data, const Param ¶ms) | |
| Constructor. | |
| ~TransformationModelBSpline () | |
| Destructor. | |
| DoubleReal | evaluate (const DoubleReal value) const |
| Evaluates the model at the given value. | |
Static Public Member Functions | |
| static void | getDefaultParameters (Param ¶ms) |
| Gets the default parameters. | |
Protected Member Functions | |
| void | getQuantiles_ (const gsl_vector *x, const std::vector< double > &quantiles, gsl_vector *results) |
| Finds quantile values. | |
| void | computeFit_ () |
| Computes the B-spline fit. | |
| void | computeLinear_ (const double pos, double &slope, double &offset, double &sd_err) |
| Computes the linear extrapolation. | |
Protected Attributes | |
| gsl_vector * | x_ |
| Vectors for B-spline computation. | |
| gsl_vector * | y_ |
| gsl_vector * | w_ |
| gsl_vector * | bsplines_ |
| gsl_vector * | coeffs_ |
| gsl_matrix * | cov_ |
| Covariance matrix. | |
| gsl_bspline_workspace * | workspace_ |
| B-spline workspace. | |
| size_t | size_ |
| Number of data points and coefficients. | |
| size_t | ncoeffs_ |
| double | xmin_ |
| double | xmax_ |
| double | slope_min_ |
| Parameters for linear extrapolation. | |
| double | slope_max_ |
| double | offset_min_ |
| double | offset_max_ |
| double | sd_err_left_ |
| Fitting errors of linear extrapolation. | |
| double | sd_err_right_ |
B-spline model for transformations.
In the range of the data points, the transformation is evaluated from a cubic smoothing spline fit to the points. The number of breakpoints is given as a parameter (num_breakpoints). Outside of this range, linear extrapolation through the last point with the slope of the spline at that point is used.
Positioning of the breakpoints is controlled by the parameter break_positions. Valid choices are "uniform" (equidistant spacing on the data range) and "quantiles" (equal numbers of data points in every interval).
| TransformationModelBSpline | ( | const DataPoints & | data, | |
| const Param & | params | |||
| ) |
Constructor.
| IllegalArgument | is thrown if not enough data points are given or if the required parameter num_breakpoints is missing. |
Destructor.
| void computeFit_ | ( | ) | [protected] |
Computes the B-spline fit.
| void computeLinear_ | ( | const double | pos, | |
| double & | slope, | |||
| double & | offset, | |||
| double & | sd_err | |||
| ) | [protected] |
Computes the linear extrapolation.
| DoubleReal evaluate | ( | const DoubleReal | value | ) | const [virtual] |
Evaluates the model at the given value.
Reimplemented from TransformationModel.
| static void getDefaultParameters | ( | Param & | params | ) | [static] |
Gets the default parameters.
Reimplemented from TransformationModel.
| void getQuantiles_ | ( | const gsl_vector * | x, | |
| const std::vector< double > & | quantiles, | |||
| gsl_vector * | results | |||
| ) | [protected] |
Finds quantile values.
| x | Data vector to find quantiles in | |
| quantiles | Quantiles to find (values between 0 and 1) | |
| results | Resulting quantiles (vector must be already allocated to the correct size!) |
gsl_vector * bsplines_ [protected] |
gsl_vector * coeffs_ [protected] |
gsl_matrix* cov_ [protected] |
Covariance matrix.
size_t ncoeffs_ [protected] |
double offset_max_ [protected] |
double offset_min_ [protected] |
double sd_err_left_ [protected] |
Fitting errors of linear extrapolation.
double sd_err_right_ [protected] |
size_t size_ [protected] |
Number of data points and coefficients.
double slope_max_ [protected] |
double slope_min_ [protected] |
Parameters for linear extrapolation.
gsl_vector * w_ [protected] |
gsl_bspline_workspace* workspace_ [protected] |
B-spline workspace.
gsl_vector* x_ [protected] |
Vectors for B-spline computation.
gsl_vector * y_ [protected] |
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:49 using doxygen 1.7.1 |