OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
linfit.h
Go to the documentation of this file.
1 /* linfit.h
2  linear fitting routine
3 
4  Project: Beam Envelope Tracker (BET)
5 
6  Revision history
7  Date Description Programmer
8  ------------ -------------------------------------------- --------------
9  09-03-06 Created Rene Bakker
10 
11  Last Revision:
12  $Id: root.h 29 2007-04-14 17:03:18Z l_bakker $
13 */
14 
15 
16 #ifndef _LINFIT_DEF
17 #define _LINFIT_DEF
18 
19 
20 /* linfit() Given a set of data points x[0..ndata-1],y[0..ndata-1] with
21  individual standard deviations sig[0..ndata-1], fit them to a
22  straight line y = a + bx by minimizing chi2. Returned are a,b and
23  their respective probable uncertainties siga and sigb, the
24  chi-square chi2, and the goodness-of-fit probability q (that the
25  fit would have chi2 this large or larger). If mwt=0 on input, then
26  the standard deviations are assumed to be unavailable: q is
27  returned as 1.0 and the normalization of chi2 is to unit standard
28  deviation on all points.
29 */
30 
31 void linfit(double x[], double y[], int ndata,
32  double sig[], int mwt, double *a, double *b, double *siga,
33  double *sigb, double *chi2, double *q);
34 
35 
36 /* linfit()
37  Given a set of data points x[0..ndata-1],y[0..ndata-1], fit them to
38  a straight line y = a + bx by minimizing chi2. Returned are a,b and
39  their respective probable uncertainties siga and sigb, and the
40  chi-square chi2.
41 */
42 void linfit(double x[], double y[], int ndata,
43  double *a, double *b, double *siga,
44  double *sigb, double *chi2);
45 
46 #endif
void linfit(double x[], double y[], int ndata, double sig[], int mwt, double *a, double *b, double *siga, double *sigb, double *chi2, double *q)
Definition: linfit.cpp:167