PSR
CHIVE
Ask a Question
Search
PSR
CHIVE:
powered by
FreeFind
Home
Install
Use
Develop
Support
News
Credits
hosted by
More
Applications
njkk08
linchi2.h
1
//-*-C++-*-
2
/***************************************************************************
3
*
4
* Copyright (C) 2003 by Aidan Hotan
5
* Licensed under the Academic Free License version 2.1
6
*
7
***************************************************************************/
8
9
#ifndef __linchi2_h_
10
#define __linchi2_h_
11
12
#include <vector>
13
14
// A simple linear chi-squared fit routine. Fits the given data
15
// to a line of the form y = a + b*x
16
// Parameters:
17
//
18
// x, y : the coordinates of the points
19
// sig : the std deviations of the points
20
// siga and sigb : the respective probable uncertainties
21
// associated with a and b
22
// chi2 : the chi-squared value
23
// q : goodness of fit probability
24
//
25
// If mwt is false, the standard deviations in y are assumed to be
26
// unknown. q is returned as 1 and chi2 is normalised to unit
27
// standard deviation on all points.
28
29
void
lin_chi2_fit(
const
std::vector<double>& x,
const
std::vector<double>& y,
30
const
std::vector<double>& sig,
31
bool
mwt,
double
& a,
double
& b,
double
& siga,
double
& sigb,
32
double
& chi2,
double
& q);
33
34
#endif
MEAL::exp
const ScalarMath exp(const ScalarMath &x)
MEAL::log
const ScalarMath log(const ScalarMath &x)
MEAL::sqrt
const ScalarMath sqrt(const ScalarMath &x)
Generated using
doxygen
1.8.17