numRecipes
Class FeldmanCousins

java.lang.Object
  extended by numRecipes.FeldmanCousins

public class FeldmanCousins
extends java.lang.Object

Implementation of the Feldman-Cousins method to calcylate the upper limit at a given C.L.


Field Summary
protected static double bgSearchStep
           
protected static double confidenceLevel
          confidence level of the flux interval
protected static double epsilon
          off set to the BG if BG=0
protected static double nBackgroundRelMax
           
protected static double nBackgroundRelMin
          Relative Background uncertainties
protected static double signalSearchRangeMax
          Range of searching the signal interval range decided by the Ferlman-Cousins
protected static double signalSearchRangeMin
          Range of searching the signal interval range decided by the Ferlman-Cousins
protected static double signalSearchStep
          step size of searching the signal interval range decided by the Ferlman-Cousins
protected static boolean treatBGuncertainties
           
 
Constructor Summary
FeldmanCousins()
           
 
Method Summary
static double getAverageUpperLimit(double nBackground)
          Calculate average upper limit of signals for expected background of nBackground.
static double getConfidenceLevel()
           
static double getLeastSignalForDiscovery(double nBackground, double nSignificance)
          Calculate the lower signal numbers that would be discovered by a given confidence level (default: 90%) with significance of nSignificance sigma.
static double getLowerLimit(double nBackground, long nObserved)
          Calculate lower limit of number of signals for a given observed number, nObserved, in expectation of nBackground and return the result.
static double getMaxRangeOfSignalIntervalCalculation()
           
static double getMinRangeOfSignalIntervalCalculation()
           
protected static double getPDFwithUncertainBG(double nSignal, double nBackground, long nObserved)
           
protected static double getSignalToMaximizeProbability(double nBackground, long nObserved)
           
static double getStepSizeOfSignalIntervalCalculation()
           
static double getUpperLimit(double nBackground, long nObserved)
          Calculate upper limit of number of signals for a given observed number, nObserved, in expectation of nBackground and return the result.
protected static boolean isNobservedWithinConfidenceBelt(double nSignal, double nBackground, long nObserved)
          Tells whether the given number of observed events are within the confidence belt for the given signal and expected background.
static void main(java.lang.String[] args)
          The simple main method - display the 90% C.L.
static void setConfidenceLevel(double cl)
           
static void setRangeOfSignalIntervalCalculation(double min, double max, double stepSize)
          Set the range of signals in calculating the signal interval - min < signal < max
static void setRelativeBackgroundUncertainty(double minusBGerr, double plusBGerr)
          Set the bacgkround uncertainty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

confidenceLevel

protected static double confidenceLevel
confidence level of the flux interval


signalSearchRangeMin

protected static double signalSearchRangeMin
Range of searching the signal interval range decided by the Ferlman-Cousins


signalSearchRangeMax

protected static double signalSearchRangeMax
Range of searching the signal interval range decided by the Ferlman-Cousins


signalSearchStep

protected static double signalSearchStep
step size of searching the signal interval range decided by the Ferlman-Cousins


bgSearchStep

protected static double bgSearchStep

epsilon

protected static double epsilon
off set to the BG if BG=0


nBackgroundRelMin

protected static double nBackgroundRelMin
Relative Background uncertainties


nBackgroundRelMax

protected static double nBackgroundRelMax

treatBGuncertainties

protected static boolean treatBGuncertainties
Constructor Detail

FeldmanCousins

public FeldmanCousins()
Method Detail

setRangeOfSignalIntervalCalculation

public static void setRangeOfSignalIntervalCalculation(double min,
                                                       double max,
                                                       double stepSize)
Set the range of signals in calculating the signal interval - min < signal < max


getMaxRangeOfSignalIntervalCalculation

public static double getMaxRangeOfSignalIntervalCalculation()

getMinRangeOfSignalIntervalCalculation

public static double getMinRangeOfSignalIntervalCalculation()

getStepSizeOfSignalIntervalCalculation

public static double getStepSizeOfSignalIntervalCalculation()

setConfidenceLevel

public static void setConfidenceLevel(double cl)

getConfidenceLevel

public static double getConfidenceLevel()

setRelativeBackgroundUncertainty

public static void setRelativeBackgroundUncertainty(double minusBGerr,
                                                    double plusBGerr)
Set the bacgkround uncertainty. If you do not call this method, then the confidence belt calculation is performed assuming that background is KNOWN i.e, the exact Felman-Cousins recipe.
        double minusBGerr :  (BGminimum - BGmean)/BGmean
        double plusBGerr :   (BGmaximum - BGmean)/BGmean
        


isNobservedWithinConfidenceBelt

protected static boolean isNobservedWithinConfidenceBelt(double nSignal,
                                                         double nBackground,
                                                         long nObserved)
Tells whether the given number of observed events are within the confidence belt for the given signal and expected background. Determined by the FelmanCousins method based upon the likelihood ratio.


getPDFwithUncertainBG

protected static double getPDFwithUncertainBG(double nSignal,
                                              double nBackground,
                                              long nObserved)

getSignalToMaximizeProbability

protected static double getSignalToMaximizeProbability(double nBackground,
                                                       long nObserved)

getUpperLimit

public static double getUpperLimit(double nBackground,
                                   long nObserved)
Calculate upper limit of number of signals for a given observed number, nObserved, in expectation of nBackground and return the result. The calculation is performed by the Feilman-Cousins method.


getLowerLimit

public static double getLowerLimit(double nBackground,
                                   long nObserved)
Calculate lower limit of number of signals for a given observed number, nObserved, in expectation of nBackground and return the result. The calculation is performed by the Feilman-Cousins method.


getAverageUpperLimit

public static double getAverageUpperLimit(double nBackground)
Calculate average upper limit of signals for expected background of nBackground. It integrates getUpperLimit(nBackground,nobserved) convoluted with Poisson(nObserved), following the recipe in the Gary and Catherrin's paper.


getLeastSignalForDiscovery

public static double getLeastSignalForDiscovery(double nBackground,
                                                double nSignificance)
Calculate the lower signal numbers that would be discovered by a given confidence level (default: 90%) with significance of nSignificance sigma. This evaluation is based on the signal discovery potential technique.


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
The simple main method - display the 90% C.L. interval for the Poisson signal mean.

Throws:
java.io.IOException