-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test options and documentation; cleaned up code
- Loading branch information
Showing
10 changed files
with
243 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "distributionFunctions.hpp" | ||
|
||
using namespace std; | ||
|
||
double pchisq( double stat, double df) { | ||
double cdf, ccdf; | ||
cumchi ( &stat, &df, &cdf, &ccdf ); | ||
return ccdf; | ||
} | ||
|
||
double pchisq( double stat, double df, double ncp) { | ||
double cdf, ccdf; | ||
cumchn( &stat, &df, &ncp, &cdf, &ccdf); | ||
return ccdf; | ||
} | ||
|
||
double qchisq( double cdf, double df) { | ||
double stat, ccdf, bd; | ||
int which = 2; | ||
ccdf = 1 - cdf; | ||
int status; | ||
cdfchi ( &which, &cdf, &ccdf, &stat, &df, &status, &bd ); | ||
return stat; | ||
} | ||
|
||
double pcauchy(double x){ | ||
return 0.5 + atan( x )/M_PI; | ||
} | ||
|
||
double qcauchy(double q){ | ||
return tan( M_PI*(q - 0.5) ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef DISTRIBUTIONFUNCTIONS_HPP | ||
#define DISTRIBUTIONFUNCTIONS_HPP | ||
|
||
#include "cdflib/cdflib.hpp" | ||
#include "eigenmvn/eigenmvn.hpp" | ||
#include "ROOT_Math/Landau.hpp" | ||
|
||
#include <iostream> | ||
#include <sstream> | ||
#include <fstream> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <math.h> | ||
#include <string> | ||
#include <algorithm> | ||
#include <vector> | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
#include <set> | ||
#include <map> | ||
|
||
using namespace std; | ||
|
||
double pcauchy(double); | ||
double qcauchy(double); | ||
|
||
double pchisq(double, double); | ||
double pchisq(double, double, double); | ||
double qchisq(double, double); | ||
|
||
#endif |
Oops, something went wrong.