ODIN
|
#include <fitting.h>
Public Member Functions | |
bool | fit (const Array< float, 1 > &yvals, const Array< float, 1 > &ysigma=defaultArray, const Array< float, 1 > &xvals=defaultArray) |
Array< float, 1 > | get_function (const Array< float, 1 > &xvals) const |
Class for linear regression of the function
y= m*x + c
For details see Numerical Recepies in C (2nd edition), section 15.2.
bool LinearFunction::fit | ( | const Array< float, 1 > & | yvals, |
const Array< float, 1 > & | ysigma = defaultArray , |
||
const Array< float, 1 > & | xvals = defaultArray |
||
) |
Linear fitting routine. Fits the function to the y-values 'yvals', and optionally the corresponding error bars 'ysigma' and x-values 'xvals'. If no error-bars are given they are all set to 1.0 and if no x-vals are given equidistant points with an increment of one are chosen, i.e. xvals(i)=i; Returns true on success.
Array<float,1> LinearFunction::get_function | ( | const Array< float, 1 > & | xvals | ) | const |
Returns the linear function values for x-values 'xvals' using the current fit parameters.