Public Member Functions | List of all members

#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
 

Detailed Description

Class for linear regression of the function

y= m*x + c

For details see Numerical Recepies in C (2nd edition), section 15.2.

Definition at line 425 of file fitting.h.

Member Function Documentation

§ fit()

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.

§ get_function()

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.


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