Public Member Functions | Private Member Functions | Private Attributes

Histogram Class Reference

The Histogram class is used to compute statistics. More...

#include <ocsHistogram.hh>

List of all members.

Public Member Functions

 Histogram ()
 Histogram (int qtBins2, double MinRange2, double MaxRange2)
 Histogram constructor.
 Histogram (string InFileName)
 Histogram constructor: Reads parameters from a file.
void InitHistogram (string InFileName)
 ~Histogram ()
 Histogram destructor.
void ReleaseMemory (void)
 Called by destructor ~Histogram().
void ClearHistogram (void)
 Reinitializes histogram.
void AddSample (double vSample)
 Adds a sample to the histogram.
void AddImportantSample (double vSample, double LikelihoodRatio)
 Adds a sample to the histogram. Used in importance sampling.
void ImportData (string InFileName, int Column, int qtColumns)
void ImportData (string InFileName)
void SetFileNameWithSamples (string FileNameWithSamples2)
void Obtain_pdf (void)
 Converts a histogram into a probability density function (pdf).
void MultipleHeuristicBalanceImport (string InFileName, int Convert2dB_Scale)
 The method of choice for merging in multiple importance sampling.
void MergeMultipleConditionalHeuristicBalance (string InFileName, double z_min, double z_max, int Convert2dB_Scale)
void MergeMultipleConditionalHeuristicBalance (string InFileName, double z_min, double z_max, double w_min, double w_max, int Convert2dB_Scale)
void MultipleWeightedImport (string InFileName)
 NOT USED AT MOMENT.
void MultipleSelectMaxRelNumHitsImport (string InFileName, int Convert2dB_Scale)
void MultipleSelectiveImport (string InFileName)
void ConditionalMultipleSelectiveImport (string InFileName, int Convert2dB_Scale)
 NOT USED AT MOMENT.
void MultipleImport (string InFileName, int Convert2dB_Scale)
 NOT USED AT MOMENT.
void MultipleUnbiasedImport (string InFileName)
 By JZ Aug 2004.
void WriteFile_pdf (string OutFileName)
void WriteFile_cdf (string OutFileName)
void WriteFile_cdfc (string OutFileName)
void WriteFileQtSamplesBin (string OutFileName)
 Write the number of hits per bin to a file.
void WriteFileBinValues (string OutFileName)
 Write the values in the bins to a file.
void WriteFilePDF (string OutFileName)
 Old code. Do not use!
void WriteFileMaxwell_pdf (string OutFileName, int qtPoints)
void WriteFileSndOrderPDV_pdf (string OutFileName, int qtPoints)
 Not used by Reduced Model!
void WriteFileGaussian_pdf (string OutFileName, int qtPoints)
void WriteFileGaussian_cdf (string OutFileName, int qtPoints)
void WriteFileGaussian_cdfc (string OutFileName, int qtPoints)
int GetQtBins (void)
double GetMinRange (void)
double GetMaxRange (void)
long GetQtSamples (void)
long GetQtSamplesInRange (void)
void SetBin (int NumBin, double ValueBin)
double GetBin (int NumBin)
double Get_cdfBin (int NumBin)
double Get_cdfcBin (int NumBin)
int GetIndex_pdf (double vSample)
long GetQtSamplesBin (int NumBin)
double GetSumLikelihoodRatio (void)
double GetMean (void)
double GetMeanSquare (void)
double GetStdDev (void)
 Get the standard deviation where normalize by qtSamples - 1.
double GetMinSample ()
double GetMaxSample ()
double GetSumProbabilities (void)
 Get the sum of all the probabilities. Use for debugging.
double Get_pdfX (int ii)
double Get_pdfY (int ii)
double Get_pdfConfidence (int ii)
double Get_cdfConfidence (int ii)
double Get_cdfcConfidence (int ii)

Private Member Functions

void InitHistogram (int qtBins2, double MinRange2, double MaxRange2)
 Private method called by Histogram constructors.

Private Attributes

int ObjectInitialized
int Index_pdf
int MakeFileWithSamples
string FileNameWithSamples
string HistInFileName
 Name of the input parameter file for Histogram class.
int qtBins
 The number of bins in the histogram.
int qtBinsLast
double MinRange
 The minimum value in the domain of the histogram (double).
double MaxRange
 The maximum value in the domain of the histogram (double).
double * Bin
double * BinSquare
double * cdfBin
double * cdfcBin
double * cdfBinSquare
double * cdfcBinSquare
long * qtSamplesBin
long qtSamples
 The total number of samples used to construct the histogram.
long qtSamplesInRange
 The total number of samples that fall in the domain of the histogram.
double SumLikelihoodRatio
 The sum of all likelihood ratios. Used in importance sampling.
double SumUnitaryLikelihoodRatio
double * pdfX
 Double array of X-values of pdf. Computed by Obtain_pdf().
double * pdfY
double * pdfConfidence
 Double array giving size of confidence interval. Computed by Obtain_pdf().
int PreviouslyComputed_pdfConfidenceFlag
double * cdfConfidence
double * cdfcConfidence
double MeanTmp
double MeanSquareTmp
double MinSample
 The minimum value of all samples. May lie outside domain of histogram!
double MaxSample
 The maximum value of all samples. May lie outside domain of histogram!
ofstream * OutFileWithSamples
double * ExpPolynomialCoef
int DebugLevel
 DebugLevel = 0 gives no output to LogFile.

Detailed Description

The Histogram class is used to compute statistics.

The Histogram class is used to compute statistics and probability density functions. It can be used for standard Monte Carlo simulations or Monte Carlo simulations with importance sampling


Constructor & Destructor Documentation

Histogram::Histogram (  )  [inline]
Histogram::Histogram ( int  qtBins2,
double  MinRange2,
double  MaxRange2 
)

Histogram constructor.

This constructor calls the private method InitHistogram

Parameters:
qtBins2 The number of bins in the histogram
MinRange2 Minimum value of the domain of the Histogram
MaxRange2 Maximum value of the domain of the Histogram
See also:
Histogram(string InFileName) ~Histogram() InitHistogram(int qtBins2,double MinRange2, double MaxRange2)

References InitHistogram(), MakeFileWithSamples, and ObjectInitialized.

Histogram::Histogram ( string  InFileName  ) 

Histogram constructor: Reads parameters from a file.

This constructor reads parameters from the file

Parameters:
InFileName,: Name of parameter input file (a C++ string)

This constructor just calls InitHistogram(string InFileName).

See also:
InitHistogram(string InFileName) Histogram(int qtBins2,double MinRange2, double MaxRange2) ~Histogram() InitHistogram AddImportantSample MakeFileWithSamples FileNameWithSamples

References InitHistogram().

Histogram::~Histogram (  ) 

Histogram destructor.

See also:
ReleaseMemory

References ReleaseMemory().


Member Function Documentation

void Histogram::AddImportantSample ( double  vSample,
double  LikelihoodRatio 
)

Adds a sample to the histogram. Used in importance sampling.

Algorithm:

  1. If the flag MakeFileWithSamples == 1, then writes sample and likelihood ratio to the file whose name is given by the string FileNameWithSamples
  2. If the sample is in the domain of the histogram, the variables used internally to compute the mean and standard deviation of the histogram are updated
  3. If the sample is in the domain of the histogram, the histogram itself is updated by placing the sample in the correct bin a weight that is given by the LikelihoodRatio
  4. The histogram of the squares of the samples is also updated.
  5. If the sample is out of range the MinSample and MaxSample values are updated.
Parameters:
vSample,: Value of sample to be added (double)
LikelihoodRatio,: Likelihood this sample would occur in a standard Monte Carlo simulation
See also:
MakeFileWithSamples Bin

References Bin, BinSquare, cdfBin, cdfBinSquare, cdfcBin, cdfcBinSquare, GetIndex_pdf(), Index_pdf, MakeFileWithSamples, MaxRange, MaxSample, MeanSquareTmp, MeanTmp, MinRange, MinSample, OutFileWithSamples, qtBins, qtSamples, qtSamplesBin, qtSamplesInRange, sq(), SumLikelihoodRatio, and SumUnitaryLikelihoodRatio.

Referenced by AddSample(), ConditionalMultipleSelectiveImport(), ImportData(), MergeMultipleConditionalHeuristicBalance(), MultipleHeuristicBalanceImport(), MultipleImport(), MultipleSelectiveImport(), MultipleSelectMaxRelNumHitsImport(), MultipleUnbiasedImport(), and MultipleWeightedImport().

void Histogram::AddSample ( double  vSample  ) 

Adds a sample to the histogram.

Used for standard Monte Carlo simulation. Calls AddImportantSample with parameter LikelihoodRatio = 1.

Parameters:
vSample,: the value of the sample to be added (double)
See also:
AddImportantSample

References AddImportantSample().

Referenced by PulseEvolutionAnalyzer::ComputePulseEnergyStats(), and ImportData().

void Histogram::ClearHistogram ( void   ) 
void Histogram::ConditionalMultipleSelectiveImport ( string  InFileName,
int  Convert2dB_Scale 
)

NOT USED AT MOMENT.

References AddImportantSample(), ClearHistogram(), Linear2dB(), qtSamples, and sgn().

double Histogram::Get_cdfBin ( int  NumBin  )  [inline]
double Histogram::Get_cdfcBin ( int  NumBin  )  [inline]
double Histogram::Get_cdfcConfidence ( int  ii  )  [inline]
double Histogram::Get_cdfConfidence ( int  ii  )  [inline]
double Histogram::Get_pdfConfidence ( int  ii  )  [inline]
double Histogram::Get_pdfX ( int  ii  )  [inline]
double Histogram::Get_pdfY ( int  ii  )  [inline]

Referenced by MultipleWeightedImport().

double Histogram::GetBin ( int  NumBin  )  [inline]
int Histogram::GetIndex_pdf ( double  vSample  ) 

References MaxRange, MinRange, and qtBins.

Referenced by AddImportantSample().

double Histogram::GetMaxRange ( void   )  [inline]
double Histogram::GetMaxSample (  )  [inline]

Referenced by Obtain_pdf().

double Histogram::GetMean ( void   )  [inline]
double Histogram::GetMeanSquare ( void   )  [inline]

Referenced by GetStdDev().

double Histogram::GetMinRange ( void   )  [inline]
double Histogram::GetMinSample (  )  [inline]

Referenced by Obtain_pdf().

int Histogram::GetQtBins ( void   )  [inline]
long Histogram::GetQtSamples ( void   )  [inline]
long Histogram::GetQtSamplesBin ( int  NumBin  )  [inline]
long Histogram::GetQtSamplesInRange ( void   )  [inline]
double Histogram::GetStdDev ( void   ) 

Get the standard deviation where normalize by qtSamples - 1.

References GetMean(), GetMeanSquare(), qtSamples, sq(), and sqrt().

Referenced by WriteFileGaussian_cdf(), WriteFileGaussian_cdfc(), WriteFileGaussian_pdf(), and PulseEvolutionAnalyzer::WriteMeanZerosStdDevOnes().

double Histogram::GetSumLikelihoodRatio ( void   )  [inline]
double Histogram::GetSumProbabilities ( void   ) 

Get the sum of all the probabilities. Use for debugging.

References MaxRange, MinRange, Obtain_pdf(), pdfY, and qtBins.

void Histogram::ImportData ( string  InFileName,
int  Column,
int  qtColumns 
)

Imports data from a file. Used when merge biased pdfs in importance sampling.

Imports a column of sample data from the file and adds the samples to the Histogram.

Parameters:
InFileName,: Name of input file (string)
Column,: The index of the column of data to be input
qtColumns,: The number of columns in the file
See also:
ImportData(string InFileName, int Column,int qtColumns) AddSample

References AddSample().

void Histogram::ImportData ( string  InFileName  ) 

Imports data from a file. Used when merge biased pdfs in importance sampling.

Imports (Sample,LikelihoodRatio)-pairs from the file.

Parameters:
InFileName,: The input file name (string)
See also:
ImportData(string InFileName, int Column,int qtColumns) AddImportantSample

References AddImportantSample().

void Histogram::InitHistogram ( string  InFileName  ) 

Like Histogram::Histogram(string InFileName), but can be used to initialize an element of an array of Histograms

This method reads parameters from the file

Parameters:
InFileName,: Name of parameter input file (a C++ string)

This constructor calls InitHistogram(int qtBins2,double MinRange2, double MaxRange2). It also initializes the flag MakeFileWithSamples and the output file name FileNameWithSamples

See also:
InitHistogram(string InFileName) Histogram(int qtBins2,double MinRange2, double MaxRange2) ~Histogram() InitHistogram AddImportantSample MakeFileWithSamples FileNameWithSamples

References DebugLevel, FileNameWithSamples, HistInFileName, LogFile, LogFileSeparator(), LOWER_AND_UPPER, LOWER_ONLY, MakeFileWithSamples, NO_BOUNDS, ObjectInitialized, OPTIONAL_WARNING, OutFileWithSamples, ReadDouble(), ReadInt(), and ReadString().

Referenced by Histogram().

void Histogram::InitHistogram ( int  qtBins2,
double  MinRange2,
double  MaxRange2 
) [private]
void Histogram::MergeMultipleConditionalHeuristicBalance ( string  InFileName,
double  z_min,
double  z_max,
double  w_min,
double  w_max,
int  Convert2dB_Scale 
)

Computes the probability density function f(X=x| z_min < Z < z_max, w_min < W < w_max), Samples of the random variables X,Z,W have been obtained from an importance sampling simulation, and that the names of the files containing the samples are stored in the file InFileName.

References AddImportantSample(), cdfcConfidence, cdfConfidence, ClearHistogram(), Get_cdfcConfidence(), Get_cdfConfidence(), Get_pdfConfidence(), Histogram(), Linear2dB(), MaxRange, MinRange, Obtain_pdf(), pdfConfidence, PreviouslyComputed_pdfConfidenceFlag, qtBins, sq(), and sqrt().

void Histogram::MergeMultipleConditionalHeuristicBalance ( string  InFileName,
double  z_min,
double  z_max,
int  Convert2dB_Scale 
)

Computes the probability density function f(X=x| z_min < Z < z_max), Samples of the random variables X,Z have been obtained from an importance sampling simulation, and that the names of the files containing the samples are stored in the file InFileName.

References AddImportantSample(), cdfcConfidence, cdfConfidence, ClearHistogram(), Get_cdfcConfidence(), Get_cdfConfidence(), Get_pdfConfidence(), Histogram(), Linear2dB(), MaxRange, MinRange, Obtain_pdf(), pdfConfidence, PreviouslyComputed_pdfConfidenceFlag, qtBins, sq(), and sqrt().

void Histogram::MultipleHeuristicBalanceImport ( string  InFileName,
int  Convert2dB_Scale 
)
void Histogram::MultipleImport ( string  InFileName,
int  Convert2dB_Scale 
)
void Histogram::MultipleSelectiveImport ( string  InFileName  ) 

This method appears to be outdated code and is not used by the reduced model

References AddImportantSample(), ClearHistogram(), Get_pdfConfidence(), Histogram(), MaxRange, MinRange, Obtain_pdf(), pdfConfidence, PreviouslyComputed_pdfConfidenceFlag, qtBins, sq(), and sqrt().

void Histogram::MultipleSelectMaxRelNumHitsImport ( string  InFileName,
int  Convert2dB_Scale 
)

Merges biased pdfs created using importance sampling into a single pdf. This is Ivan Lima's Maximum Number of Hits Heuristic.

The biased pdf's are assumed to have been previously generated by calls to methods like Histogram::WriteFile_pdf(string OutFileName).

Parameters:
InFileName,: Name of file that contains a list of the files containing the biased pdf's. All biased pdf's are assumed to have the same discretized domain.
Convert2dB_Scale,: Flag that specifies whether or not to convert the pdfs to be merged from a linear to dB scale.

The method does the following:

  1. Reads in the file names of the pdf's from InFileName. You can have up to 100 files.
  2. For each input pdf construct a Histogram object and add (Sample, LikelihoodRatio) pairs to the histogram by reading in data from the file
  3. Call Histogram::Obtain_pdf for each input pdf.

Next for each bin in the domain of the histograms:

  1. For each of the input biased pdf's compute the number of samples in the bin relative to the total number of samples in the input biased pdf. Call this number the Relative Number of Hits in the given bin for the given biased pdf.
  2. For this histogram, (the one that is calling this method) set the value of the bin in question to be the maximum of the Relative Number of Hits, where we maximize over all the biased pdfs.

Finally, we normalize the histogram by forcing the number of samples to be 1. This will give us the correct statistics WHY???.

Note that because of the way the histogram has been constructed we can't use the methods GetMean(), GetMax(), GetQtSamples(), etc.

References AddImportantSample(), Bin, cdfBin, cdfcBin, ClearHistogram(), Get_pdfConfidence(), GetBin(), GetQtSamples(), GetQtSamplesBin(), HistInFileName, Histogram(), Linear2dB(), LogFile, Obtain_pdf(), pdfConfidence, PreviouslyComputed_pdfConfidenceFlag, qtBins, qtSamples, qtSamplesInRange, SumLikelihoodRatio, and SumUnitaryLikelihoodRatio.

void Histogram::MultipleUnbiasedImport ( string  InFileName  ) 

By JZ Aug 2004.

Imports the data from files created by the histogram class and merge multiple sets of files. This method is useful to merge all the samples of independent unbiased simulations, i.e., we assume LikelihoodRatio=1.0

By: Ivan Lima (12/5/01). Adapted by JZ Aug 2004

References AddImportantSample(), ClearHistogram(), Histogram(), MaxRange, MinRange, Obtain_pdf(), and qtBins.

void Histogram::MultipleWeightedImport ( string  InFileName  ) 
void Histogram::Obtain_pdf ( void   ) 

Converts a histogram into a probability density function (pdf).

This method converts the discrete histogram data into a pdf.
It sets the values of three arrays:

  1. pdfX: Stores the discrete values of the independent variable of the pdf. These values are computed using the centers of the bins.
  2. pdfY: Stores the dependent values of the pdf. The pdf is normalized to have integral 1.
  3. pdfConfidence: ASK IVAN

References Bin, BinSquare, cdfBin, cdfBinSquare, cdfcBin, cdfcBinSquare, cdfcConfidence, cdfConfidence, GetMaxSample(), GetMinSample(), MaxRange, MinRange, pdfConfidence, pdfX, pdfY, PreviouslyComputed_pdfConfidenceFlag, qtBins, qtSamples, qtSamplesInRange, sq(), and sqrt().

Referenced by GetSumProbabilities(), MergeMultipleConditionalHeuristicBalance(), MultipleHeuristicBalanceImport(), MultipleImport(), MultipleSelectiveImport(), MultipleSelectMaxRelNumHitsImport(), MultipleUnbiasedImport(), MultipleWeightedImport(), WriteFile_cdf(), WriteFile_cdfc(), WriteFile_pdf(), WriteFilePDF(), and WriteFileQtSamplesBin().

void Histogram::ReleaseMemory ( void   ) 
void Histogram::SetBin ( int  NumBin,
double  ValueBin 
) [inline]
void Histogram::SetFileNameWithSamples ( string  FileNameWithSamples2  ) 
void Histogram::WriteFile_cdf ( string  OutFileName  ) 

Writes the cumulative density function (cdf) computed by the histogram object to a file

The method first calls Obtain_pdf to compute the pdf

The output file is a matrix of size qtBins by 3:

  1. Column 1 is the vector pdfX
  2. Column 2 is the cdf vector
  3. Column 3 is the vector pdfConfidence, currently set to zero.
See also:
Obtain_pdf

References cdfBin, cdfConfidence, MaxRange, MinRange, Obtain_pdf(), pdfX, qtBins, and qtSamples.

void Histogram::WriteFile_cdfc ( string  OutFileName  ) 

Writes the complement of the cumulative density function (cdf) computed by the histogram object to a file

This method is used in applications to compute outage probabilities!

The method first calls Obtain_pdf to compute the pdf

The output file is a matrix of size qtBins by 3:

  1. Column 1 is the vector pdfX
  2. Column 2 is the cdfc vector
  3. Column 3 is the vector pdfConfidence, currently set to zero.
See also:
Obtain_pdf

References cdfcBin, cdfcConfidence, MaxRange, MinRange, Obtain_pdf(), pdfX, qtBins, and qtSamples.

void Histogram::WriteFile_pdf ( string  OutFileName  ) 

Writes the probability density function (pdf) computed by the histogram object to a file

The method first calls Obtain_pdf to compute the pdf

The output file is a matrix of size qtBins by 3:

  1. Column 1 is the vector pdfX
  2. Column 2 is the vector pdfY
  3. Column 3 is the vector pdfConfidence (relative to the pdf)
See also:
Obtain_pdf

References Obtain_pdf(), pdfConfidence, pdfX, pdfY, and qtBins.

void Histogram::WriteFileBinValues ( string  OutFileName  ) 

Write the values in the bins to a file.

References Bin, pdfX, and qtBins.

void Histogram::WriteFileGaussian_cdf ( string  OutFileName,
int  qtPoints 
)
void Histogram::WriteFileGaussian_cdfc ( string  OutFileName,
int  qtPoints 
)
void Histogram::WriteFileGaussian_pdf ( string  OutFileName,
int  qtPoints 
)

Computes a Gaussian pdf with same mean and standard devaition as Histogram's pdf and writes it to a file

The domain of the Gaussian pdf is the same as the domain of the histogram

Parameters:
OutFileName,: Name of the output file for the Gaussian pdf
qtPoints,: Number of points in the discretization of the Gaussian pdf

The first column of the output is the discretized domain of the histogram. The second column are the values of the pdf.

References GetMean(), GetStdDev(), MaxRange, MinRange, pi, sq(), and sqrt().

void Histogram::WriteFileMaxwell_pdf ( string  OutFileName,
int  qtPoints 
)

Computes a Maxwellian pdf with same mean as Histogram's pdf and writes it to a file

The domain of the Maxwellian pdf is the same as the domain of the histogram

Parameters:
OutFileName,: Name of the output file for the Maxwellian pdf
qtPoints,: Number of points in the discretization of the Maxwellian pdf

References cube(), GetMean(), MaxRange, MinRange, pi, sq(), and sqrt().

void Histogram::WriteFilePDF ( string  OutFileName  ) 

Old code. Do not use!

References Obtain_pdf(), pdfX, pdfY, qtBins, qtSamples, and qtSamplesInRange.

void Histogram::WriteFileQtSamplesBin ( string  OutFileName  ) 

Write the number of hits per bin to a file.

The method first calls Obtain_pdf to compute the pdf

The output file is a matrix of size qtBins by 3:

  1. Column 1 is the vector pdfX
  2. Column 2 is the number of hits per bin
  3. Column 3 is the vector pdfConfidence (not necessarily debugged)
See also:
Obtain_pdf

References Obtain_pdf(), pdfConfidence, pdfX, qtBins, and qtSamplesBin.

void Histogram::WriteFileSndOrderPDV_pdf ( string  OutFileName,
int  qtPoints 
)

Not used by Reduced Model!

Writes to a file the theoretical pdf of the length of the second order component of the polarization dispersion vector, with the same mean as that of the Histogram

References GetMean(), MaxRange, MinRange, pi, and sq().


Member Data Documentation

double* Histogram::Bin [private]

Double array of length qtBins used to store the binned samples of the histogram, weighted by their likelihood.

Each bin of the histogram has an associated indicator function. The indicator function I_i of the i-th bin is a binary function on samples. It takes the value 1 if the sample is placed in the i-th bin and the value 0 otherwise. In other words I_i is a binary random variable. The mean of I_i gives the probability of being in the bin. The standard deviation of I_i is a measure of how close the mean of I_i is to the true value of the pdf. The confidence interval of the i-th bin in a histogram is [mean(I_i) - std_dev(I_i), mean(I_i) + std_dev(I_i)]. There is a large chance that the true probability of being in the i-th bin lies in the confidence interval. So the smaller std_dev(I_i)/mean(I_i) the more accurately the histogram estimates the true pdf.

In standard Monte Carlo the probability of being in [a,b] is the sum over all samples of the indicator function of [a,b] evaluated at the sample, divided by the number of samples.

In importance sampling the probability of being in [a,b] is the sum over all samples of the product of the indicator function of [a,b] evaluated at the sample and the likelihood that the sample would actually occur, divided by the number of samples.

Referenced by AddImportantSample(), ClearHistogram(), InitHistogram(), MultipleSelectMaxRelNumHitsImport(), MultipleWeightedImport(), Obtain_pdf(), ReleaseMemory(), and WriteFileBinValues().

double* Histogram::BinSquare [private]

Double array of length qtBins used to store the squares of the binned samples of the histogram, weighted by their likelihood.

Used to compute confidence intervals.

See also:
Bin

Referenced by AddImportantSample(), ClearHistogram(), InitHistogram(), Obtain_pdf(), and ReleaseMemory().

double* Histogram::cdfBin [private]

Integer array containing the number of samples that have been placed in a bin.

For standard Monte Carlo qtSamplesBin[i] = Bin[i], but this is not true for importance sampling, since the binned samples are weighted by their Likelihood ratio.

Referenced by AddImportantSample(), ClearHistogram(), InitHistogram(), MultipleSelectMaxRelNumHitsImport(), Obtain_pdf(), ReleaseMemory(), and WriteFile_cdf().

double* Histogram::cdfBinSquare [private]
double* Histogram::cdfcBin [private]
double* Histogram::cdfcBinSquare [private]
double* Histogram::cdfcConfidence [private]
double* Histogram::cdfConfidence [private]
int Histogram::DebugLevel [private]

DebugLevel = 0 gives no output to LogFile.

Referenced by InitHistogram().

double* Histogram::ExpPolynomialCoef [private]

Referenced by InitHistogram(), and ReleaseMemory().

Name of the output file to which (sample,likelihood ratio)-pairs are written. Used in importance sampling.

See also:
MakeFileWithSamples AddImportantSample

Referenced by InitHistogram(), and SetFileNameWithSamples().

string Histogram::HistInFileName [private]

Name of the input parameter file for Histogram class.

See also:
Histogram(string InFileName)

Referenced by InitHistogram(), MultipleSelectMaxRelNumHitsImport(), and MultipleWeightedImport().

int Histogram::Index_pdf [private]

Referenced by AddImportantSample().

Flag that controls whether (sample,likelihood ratio)-pairs are written to the output file named string FileNameWithSamples. Used in importance sampling

See also:
Histogram(string InFileName)
FileNameWithSamples AddImportantSample

Referenced by AddImportantSample(), Histogram(), InitHistogram(), ReleaseMemory(), and SetFileNameWithSamples().

double Histogram::MaxRange [private]
double Histogram::MaxSample [private]

The maximum value of all samples. May lie outside domain of histogram!

Referenced by AddImportantSample().

double Histogram::MeanSquareTmp [private]
double Histogram::MeanTmp [private]
double Histogram::MinRange [private]
double Histogram::MinSample [private]

The minimum value of all samples. May lie outside domain of histogram!

Referenced by AddImportantSample().

Referenced by Histogram(), and InitHistogram().

ofstream* Histogram::OutFileWithSamples [private]
double* Histogram::pdfConfidence [private]
double* Histogram::pdfX [private]
double* Histogram::pdfY [private]

Double array of Y-values of pdf. Computed by Obtain_pdf()

See also:
Bin

Referenced by GetSumProbabilities(), InitHistogram(), Obtain_pdf(), ReleaseMemory(), WriteFile_pdf(), and WriteFilePDF().

int Histogram::qtBins [private]
int Histogram::qtBinsLast [private]

Referenced by InitHistogram().

long Histogram::qtSamples [private]
long* Histogram::qtSamplesBin [private]

The total number of samples that fall in the domain of the histogram.

Referenced by AddImportantSample(), ClearHistogram(), MultipleSelectMaxRelNumHitsImport(), MultipleWeightedImport(), Obtain_pdf(), and WriteFilePDF().

The sum of all likelihood ratios. Used in importance sampling.

Referenced by AddImportantSample(), ClearHistogram(), MultipleSelectMaxRelNumHitsImport(), and MultipleWeightedImport().

Used only in standard Monte Carlo. Is the same as number of samples. Not used in code.

Referenced by AddImportantSample(), ClearHistogram(), MultipleSelectMaxRelNumHitsImport(), and MultipleWeightedImport().


The documentation for this class was generated from the following files: