Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Pawian
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PWA
Pawian
Commits
9d803934
Commit
9d803934
authored
6 years ago
by
Bertram Kopf
Browse files
Options
Downloads
Patches
Plain Diff
added useful statistical tool script
parent
7b7361ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Scripts/StatisticalTools.C
+46
-0
46 additions, 0 deletions
Scripts/StatisticalTools.C
with
46 additions
and
0 deletions
Scripts/StatisticalTools.C
0 → 100644
+
46
−
0
View file @
9d803934
//************************************************************************//
// //
// Copyright 2018 Bertram Kopf (bertram@ep1.rub.de) //
// - Ruhr-Universität Bochum //
// //
// This file is part of Pawian. //
// //
// Pawian is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Pawian is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Pawian. If not, see <http://www.gnu.org/licenses/>. //
// //
//************************************************************************//
#pragma once
//#include "Root.h"
#include
<cmath>
#include
<iostream>
class
StatisticalTools
{
public:
static
double
sigmaFromLikelihoodRatio
(
unsigned
double
diffLH
,
unsigned
int
diffParams
){
return
ROOT
::
Math
::
chisquared_quantile_c
(
TMath
::
Prob
(
2
.
*
diffLH
,
diffParams
),
1
);
}
static
double
sigmaFromLikelihoodRatio
(
double
LH1
,
int
ndf1
,
double
LH2
,
int
ndf2
){
double
diffLH
=
fabs
(
LH1
-
LH2
);
int
diffParams
=
ndf1
-
ndf2
;
if
(
diffParams
<
0
){
cout
<<
"ndf2 > ndf1 !!!!
\n
"
<<
"this is not supported!!!"
<<
endl
;
return
-
10000000000000
.;
}
return
sigmaFromLikelihoodRatio
(
diffLH
,
diffParams
);
}
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment