Go to the source code of this file.
|
void | BinLogLikelihoodRatio (long Nentries, long Nfailures, double epsilon_max, double *S_fail_obs, double *S_pass_obs) |
|
void | PoissionLogLikelihoodRatio (double data, double hypothesis, double epsilon_max, double epsilon_min, double *S_fail_obs, double *S_pass_obs) |
|
void BinLogLikelihoodRatio |
( |
long |
Nentries, |
|
|
long |
Nfailures, |
|
|
double |
epsilon_max, |
|
|
double * |
S_fail_obs, |
|
|
double * |
S_pass_obs |
|
) |
| |
Definition at line 7 of file QStatisticalTests.cc.
References N, gen::n, and mathSSE::sqrt().
32 long N = Nentries,
n = Nfailures;
35 double epsilon_meas = (double) n / (
double)
N;
38 ((double) n ) * ( Log(epsilon_meas) - Log(epsilon_max) ) +
39 ((
double) (N -
n)) * ( Log(1.0 - epsilon_meas) - Log(1.0 - epsilon_max) );
47 else if( Nfailures == 0 && ( epsilon_max <= 1.0 / (
double) Nentries ) )
52 else if( Nfailures == 0 )
55 *S_pass_obs =
sqrt( 2.0 * LogQ );
57 else if( Nfailures == Nentries )
59 *S_fail_obs =
sqrt( 2.0 * LogQ );
62 else if( epsilon_meas >= epsilon_max )
64 *S_fail_obs =
sqrt( 2.0 * LogQ );
70 *S_pass_obs =
sqrt( 2.0 * LogQ );
void PoissionLogLikelihoodRatio |
( |
double |
data, |
|
|
double |
hypothesis, |
|
|
double |
epsilon_max, |
|
|
double |
epsilon_min, |
|
|
double * |
S_fail_obs, |
|
|
double * |
S_pass_obs |
|
) |
| |
Definition at line 76 of file QStatisticalTests.cc.
References AlCaHLTBitMon_QueryRunRegistry::data, and mathSSE::sqrt().
104 double tolerance_min = hypothesis*(1.0-epsilon_min);
105 double tolerance_max = hypothesis*(1.0+epsilon_max);
108 if(
data > tolerance_max )
110 double Nsig =
data - tolerance_max;
111 double Nbak = tolerance_max;
112 double LogQ = (double) (Nsig + Nbak) *
113 Log( 1.0 + (
double) Nsig / (
double) Nbak ) - (double) Nsig;
114 *S_fail_obs =
sqrt( 2.0 * LogQ );
116 else if( tolerance_min <
data &&
data < tolerance_max )
118 if(
data - hypothesis > 0.0 )
120 double Nsig = tolerance_max -
data;
121 double Nbak = tolerance_max;
122 double LogQ = (double) (Nsig + Nbak) *
123 Log( 1.0 + (
double) Nsig / (
double) Nbak ) - (double) Nsig;
124 *S_pass_obs =
sqrt( 2.0 * LogQ );
128 double Nsig = data - tolerance_min;
129 double Nbak = tolerance_min;
130 double LogQ = (double) (Nsig + Nbak) *
131 Log( 1.0 + (
double) Nsig / (
double) Nbak ) - (double) Nsig;
132 *S_pass_obs =
sqrt( 2.0 * LogQ );
137 double Nsig = tolerance_min -
data;
138 double Nbak = tolerance_min;
139 double LogQ = (double) (Nsig + Nbak) *
140 Log( 1.0 + (
double) Nsig / (
double) Nbak ) - (double) Nsig;
141 *S_fail_obs =
sqrt( 2.0 * LogQ );