LinearFunction Struct Reference
[Classes of the ODIN data processing framework (odindata library)]

#include <fitting.h>

Collaboration diagram for LinearFunction:

Collaboration graph
[legend]
List of all members.

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

Public Attributes

fitpar m
fitpar c

Static Public Attributes

static const Array< float, 1 > defaultArray

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 275 of file fitting.h.


Member Function Documentation

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'.


The documentation for this struct was generated from the following file:
Generated on Sat Jun 14 12:31:42 2008 by  doxygen 1.5.1