MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
MiscFunction.hxx File Reference

Header file for Regression and FindFitParameters functions. More...

#include <iostream>
#include <sstream>
#include <vector>
#include <string>

Go to the source code of this file.

Functions

void Regression (int N, const vector< double > &x, const vector< double > &y, const vector< double > &y_sdev, double &A, double &B, double &A_sdev, double &B_sdev, double &chi2)
 Linear Regression function. More...
 
void FindFitParameters (int N, const vector< double > &x, const vector< double > &y, const vector< double > &y_sdev, double &A, double &B)
 Find Slope and Intersept of fit. More...
 
string __macro_method_name__ (string x)
 this is for METHOD_NAME macro, extracting method name from PRETTY_FUNCTION More...
 
string wordwrap (string x, int w)
 word-wrap a string More...
 

Detailed Description

Header file for Regression and FindFitParameters functions.

Function Documentation

string __macro_method_name__ ( string  x)

this is for METHOD_NAME macro, extracting method name from PRETTY_FUNCTION

void FindFitParameters ( int  N,
const vector< double > &  x,
const vector< double > &  y,
const vector< double > &  y_sdev,
double &  A,
double &  B 
)

Find Slope and Intersept of fit.

The method uses the Regression function.

Author
PTO
Version
1.0
Parameters
N: Number of point to use for the regression
x: vector of X axis (only the N first are taken into account)
y: vector of Y axis value (only the N first are taken into account)
y_sdev: vector of Y axis error value (only the N first are taken into account). if size=0 no weights are used
A: the slope of the regression
B: the intersept of the regression
void Regression ( int  N,
const vector< double > &  x,
const vector< double > &  y,
const vector< double > &  y_sdev,
double &  A,
double &  B,
double &  A_sdev,
double &  B_sdev,
double &  chi2 
)

Linear Regression function.

The method is taken from Numerical Recipes and converted in C++ form.

Author
PTO
Version
1.0
Parameters
N: Number of point to use for the regression
x: vector of X axis (only the N first are taken into account)
y: vector of Y axis value (only the N first are taken into account)
y_sdev: vector of Y axis error value (only the N first are taken into account). if size=0 no weights are used
A: the slope of the regression
B: the intersept of the regression
A_sdev: the slope error of the regression
B_sdev: the slope intersept of the regression
chi2,:the chi square
string wordwrap ( string  x,
int  w 
)

word-wrap a string

Parameters
x: String to be wrapped
w: Maximum width

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014