changed normalization of log max likelihood
This commit is contained in:
parent
392cd0b4b3
commit
e2712ce3f7
@ -53,6 +53,9 @@ FIXED 2012-09-23 fixed wrong chisq output in musrview if expected chisq is
|
||||
present.
|
||||
FIXED 2012-05-30 fixed RRF bug in single histo plotting.
|
||||
FIXED 2012-05-18 fixed wrong forward/backward tag for ROOT-PPC (MUSR-215)
|
||||
CHANGED 2013-11-12 changed normalization of log max likelihood according to S.
|
||||
Backer and R.D. Cousins NIM 221, 437 (1984), in order to have a
|
||||
"goodness-of-fit" criteria.
|
||||
CHANGED 2012-12-11 if multiple SAVE are present in the COMMAND block, append
|
||||
MINUIT2.OUTPUT file. Added docu for PRINT_LEVEL (MUSR-244).
|
||||
CHANGED 2012-11-19 replaced hard coded gyromagnetic ratio of the muon in the
|
||||
|
@ -261,6 +261,11 @@ Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
|
||||
data = fData.GetValue()->at(i);
|
||||
|
||||
if (theo <= 0.0) {
|
||||
cerr << ">> PRunMuMinus::CalcMaxLikelihood: **WARNING** NEGATIVE theory!!" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data > 1.0e-9) {
|
||||
mllh += (theo-data) + data*log(data/theo);
|
||||
} else {
|
||||
@ -268,7 +273,7 @@ Double_t PRunMuMinus::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
}
|
||||
}
|
||||
|
||||
return mllh;
|
||||
return 2.0*mllh;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
@ -376,14 +376,19 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
chunk = 10;
|
||||
#pragma omp parallel for default(shared) private(i,time,theo,data) schedule(dynamic,chunk) reduction(-:mllh)
|
||||
#endif
|
||||
for (i=startTimeBin; i < endTimeBin; ++i) {
|
||||
for (i=startTimeBin; i<endTimeBin; ++i) {
|
||||
time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep();
|
||||
// calculate theory for the given parameter set
|
||||
theo = N0*TMath::Exp(-time/tau)*(1+fTheory->Func(time, par, fFuncValues))+bkg;
|
||||
theo = N0*TMath::Exp(-time/tau)*(1.0+fTheory->Func(time, par, fFuncValues))+bkg;
|
||||
theo *= normalizer;
|
||||
|
||||
data = normalizer*fData.GetValue()->at(i);
|
||||
|
||||
if (theo <= 0.0) {
|
||||
cerr << ">> PRunSingleHisto::CalcMaxLikelihood: **WARNING** NEGATIVE theory!!" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data > 1.0e-9) {
|
||||
mllh += (theo-data) + data*log(data/theo);
|
||||
} else {
|
||||
@ -391,7 +396,7 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
|
||||
}
|
||||
}
|
||||
|
||||
return mllh;
|
||||
return 2.0*mllh;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user