1package umontreal.ssj.stat;
3import umontreal.ssj.util.PrintfFormat;
52 for (
int i = 0; i < numBins; i++)
62 public void add(
double x) {
64 if ((x >= m_a) & (x <= m_b))
65 ++count[(int) ((x - m_a) / m_h)];
70 throw new IllegalStateException(
"HistogramOnly.variance() is not supported.");
76 throw new IllegalStateException(
"HistogramOnly.variance() is not supported.");
82 throw new IllegalStateException(
"HistogramOnly.variance() is not supported.");
98 StringBuffer sb =
new StringBuffer();
104 for (
int i = 0; i < numBins; i++) {
105 double a = m_a + (i - 1) * m_h;
106 double b = m_a + i * m_h;
111 return sb.toString();
117 throw new IllegalStateException(
"HistogramOnly.report() is not supported.");
123 throw new IllegalStateException(
"HistogramOnly.shortReport() is not supported.");
129 throw new IllegalStateException(
"HistogramOnly.shortReportHeader() is not supported.");
double variance()
Returns the sample variance of the observations since the last initialization.
HistogramOnly(String name, double a, double b, int s)
Constructs a new HistogramOnly statistical probe with name name.
void add(double x)
Gives a new observation to the statistical collectors.
String shortReport()
Formats and returns a short statistical report for this tally.
String report()
Returns a formatted string that contains a report on this probe.
String shortReportHeader()
Returns a string containing the name of the values returned in the report strings.
double sum()
Returns the sum cumulated so far for this probe.
String toString()
Returns the bin counters as a String.
double average()
Returns the average value of the observations since the last initialization.
void init()
Initializes all the counters and accumulators, including those of the Tally object.
HistogramOnly(double a, double b, int s)
Constructs a HistogramOnly statistical probe.
HistogramOnly clone()
Clones this object and the array which stores the counters.
TallyHistogram(double a, double b, int numBins)
Constructs a TallyHistogram statistical probe.