Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Member Functions | Static Public Attributes | List of all members
mygsl::linear_regression Class Reference

The linear regression algorithm. More...

#include <bayeux/mygsl/linear_regression.h>

Classes

class  fit_data
 The serializable result data of the linear regression algorithm. More...
 
class  function
 A linear regression fit function. More...
 

Public Member Functions

bool is_initialized () const
 Check initialization flag. More...
 
bool can_weighted () const
 Check if a weighted fit can pe performed. More...
 
const fit_dataget_fit_data () const
 Return the result of the fit. More...
 
 linear_regression ()
 Default constructor. More...
 
 linear_regression (const std::vector< datapoint > &p_)
 Construct from an array of datapoints (x,y,w) triplets. More...
 
 linear_regression (size_t npoints_, const double *x_, const double *y_, const double *w_=0)
 Construct from plain arrays of x, y and w values. More...
 
 linear_regression (const std::vector< double > &x_, const std::vector< double > &y_, const std::vector< double > &w_)
 Construct from vectors of x, y and w values. More...
 
 linear_regression (const std::vector< double > &x_, const std::vector< double > &y_)
 Construct from vectors of x and y values (no weights) More...
 
virtual ~linear_regression ()
 Destructor. More...
 
void init (const std::vector< datapoint > &p_)
 Initialize from an array of datapoints (x,y,w) triplets. More...
 
void init (size_t npoints_, const double *x_, const double *y_, const double *w_=0)
 Initialize from plain arrays of x, y and optional w values. More...
 
void init (const std::vector< double > &x_, const std::vector< double > &y_, const std::vector< double > &w_)
 Initialize from vectors of x, y and w values. More...
 
void init (const std::vector< double > &x_, const std::vector< double > &y_)
 Construct from vectors of x and y values (no weights) More...
 
void reset ()
 Reset. More...
 
bool fit_linear ()
 Perform the linear unweighted fit. More...
 
bool fit_weighted_linear ()
 Perform the linear weighted fit. More...
 
bool fit_linear_no_constant ()
 Perform the linear unweighted fit without constant parameter. More...
 
bool fit_weighted_linear_no_constant ()
 Perform the linear weighted fit without constant parameter. More...
 

Static Public Attributes

static const unsigned int MINIMUM_NUMBER_OF_DATA_POINTS = 2
 Minimum number of data points to perform the linear regression fit. More...
 

Detailed Description

The linear regression algorithm.

Constructor & Destructor Documentation

◆ linear_regression() [1/5]

mygsl::linear_regression::linear_regression ( )

Default constructor.

◆ linear_regression() [2/5]

mygsl::linear_regression::linear_regression ( const std::vector< datapoint > &  p_)

Construct from an array of datapoints (x,y,w) triplets.

◆ linear_regression() [3/5]

mygsl::linear_regression::linear_regression ( size_t  npoints_,
const double *  x_,
const double *  y_,
const double *  w_ = 0 
)

Construct from plain arrays of x, y and w values.

◆ linear_regression() [4/5]

mygsl::linear_regression::linear_regression ( const std::vector< double > &  x_,
const std::vector< double > &  y_,
const std::vector< double > &  w_ 
)

Construct from vectors of x, y and w values.

◆ linear_regression() [5/5]

mygsl::linear_regression::linear_regression ( const std::vector< double > &  x_,
const std::vector< double > &  y_ 
)

Construct from vectors of x and y values (no weights)

◆ ~linear_regression()

virtual mygsl::linear_regression::~linear_regression ( )
virtual

Destructor.

Member Function Documentation

◆ can_weighted()

bool mygsl::linear_regression::can_weighted ( ) const

Check if a weighted fit can pe performed.

◆ fit_linear()

bool mygsl::linear_regression::fit_linear ( )

Perform the linear unweighted fit.

◆ fit_linear_no_constant()

bool mygsl::linear_regression::fit_linear_no_constant ( )

Perform the linear unweighted fit without constant parameter.

◆ fit_weighted_linear()

bool mygsl::linear_regression::fit_weighted_linear ( )

Perform the linear weighted fit.

◆ fit_weighted_linear_no_constant()

bool mygsl::linear_regression::fit_weighted_linear_no_constant ( )

Perform the linear weighted fit without constant parameter.

◆ get_fit_data()

const fit_data& mygsl::linear_regression::get_fit_data ( ) const

Return the result of the fit.

◆ init() [1/4]

void mygsl::linear_regression::init ( const std::vector< datapoint > &  p_)

Initialize from an array of datapoints (x,y,w) triplets.

◆ init() [2/4]

void mygsl::linear_regression::init ( size_t  npoints_,
const double *  x_,
const double *  y_,
const double *  w_ = 0 
)

Initialize from plain arrays of x, y and optional w values.

◆ init() [3/4]

void mygsl::linear_regression::init ( const std::vector< double > &  x_,
const std::vector< double > &  y_,
const std::vector< double > &  w_ 
)

Initialize from vectors of x, y and w values.

◆ init() [4/4]

void mygsl::linear_regression::init ( const std::vector< double > &  x_,
const std::vector< double > &  y_ 
)

Construct from vectors of x and y values (no weights)

◆ is_initialized()

bool mygsl::linear_regression::is_initialized ( ) const

Check initialization flag.

◆ reset()

void mygsl::linear_regression::reset ( )

Reset.

Member Data Documentation

◆ MINIMUM_NUMBER_OF_DATA_POINTS

const unsigned int mygsl::linear_regression::MINIMUM_NUMBER_OF_DATA_POINTS = 2
static

Minimum number of data points to perform the linear regression fit.


The documentation for this class was generated from the following file: