697 lines
32 KiB
HTML
697 lines
32 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:04 EDT 2016 -->
|
|
<title>Histogram (Parallel Java 2 Library Documentation)</title>
|
|
<meta name="date" content="2016-04-06">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="Histogram (Parallel Java 2 Library Documentation)";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar_top">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Histogram.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/numeric/Int96.html" title="class in edu.rit.numeric"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/numeric/Histogram.html" target="_top">Frames</a></li>
|
|
<li><a href="Histogram.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">edu.rit.numeric</div>
|
|
<h2 title="Class Histogram" class="title">Class Histogram</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>edu.rit.numeric.Histogram</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl>
|
|
<dt>All Implemented Interfaces:</dt>
|
|
<dd><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a></dd>
|
|
</dl>
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">Histogram</span>
|
|
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
|
|
implements <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a>, <a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></pre>
|
|
<div class="block">Class Histogram is the base class for a histogram that categorizes values
|
|
into bins and counts the number of occurrences in each bin. Subclasses of
|
|
class Histogram categorize items of various types.
|
|
<P>
|
|
Class Histogram supports doing a chi-square test on the bin counts. See the
|
|
<a href="../../../edu/rit/numeric/Histogram.html#chisqr()"><code>chisqr()</code></a>, <a href="../../../edu/rit/numeric/Histogram.html#pvalue(double)"><code>pvalue()</code></a>, and <a href="../../../edu/rit/numeric/Histogram.html#expectedCount(int)"><code>expectedCount()</code></a> methods.</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colOne" scope="col">Constructor and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#Histogram()">Histogram</a></strong>()</code>
|
|
<div class="block">Construct a new uninitialized histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#Histogram(edu.rit.numeric.Histogram)">Histogram</a></strong>(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</code>
|
|
<div class="block">Construct a new histogram that is a deep copy of the given histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#Histogram(int)">Histogram</a></strong>(int B)</code>
|
|
<div class="block">Construct a new histogram with the given number of bins.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#accumulate(double)">accumulate</a></strong>(double x)</code>
|
|
<div class="block">Accumulate the given value of type <TT>double</TT> into this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#accumulate(float)">accumulate</a></strong>(float x)</code>
|
|
<div class="block">Accumulate the given value of type <TT>float</TT> into this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#accumulate(int)">accumulate</a></strong>(int x)</code>
|
|
<div class="block">Accumulate the given value of type <TT>int</TT> into this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#accumulate(long)">accumulate</a></strong>(long x)</code>
|
|
<div class="block">Accumulate the given value of type <TT>long</TT> into this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><T> void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#accumulate(T)">accumulate</a></strong>(T x)</code>
|
|
<div class="block">Accumulate the given object of type <TT>T</TT> into this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#add(edu.rit.numeric.Histogram)">add</a></strong>(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</code>
|
|
<div class="block">Add the given histogram to this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#chisqr()">chisqr</a></strong>()</code>
|
|
<div class="block">Returns the chi-square statistic for this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#clear()">clear</a></strong>()</code>
|
|
<div class="block">Clear this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#clone()">clone</a></strong>()</code>
|
|
<div class="block">Create a clone of this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#copy(edu.rit.numeric.Histogram)">copy</a></strong>(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</code>
|
|
<div class="block">Make this histogram be a deep copy of the given histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#count(int)">count</a></strong>(int i)</code>
|
|
<div class="block">Returns the count in the given bin of this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#expectedCount(int)">expectedCount</a></strong>(int i)</code>
|
|
<div class="block">Determine the expected count in the given bin for a chi-square test.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#expectedProb(int)">expectedProb</a></strong>(int i)</code>
|
|
<div class="block">Determine the expected probability of incrementing the given bin for a
|
|
chi-square test.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>protected void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#increment(int)">increment</a></strong>(int i)</code>
|
|
<div class="block">Increment the given bin in this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#prob(int)">prob</a></strong>(int i)</code>
|
|
<div class="block">Returns the observed probability of incrementing the count in the given
|
|
bin of this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#pvalue(double)">pvalue</a></strong>(double chisqr)</code>
|
|
<div class="block">Returns the p-value of the given chi-square statistic for this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#readIn(edu.rit.io.InStream)">readIn</a></strong>(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)</code>
|
|
<div class="block">Read this histogram from the given in stream.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#size()">size</a></strong>()</code>
|
|
<div class="block">Returns the number of bins in this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#total()">total</a></strong>()</code>
|
|
<div class="block">Returns the total count in all bins of this histogram.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/Histogram.html#writeOut(edu.rit.io.OutStream)">writeOut</a></strong>(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)</code>
|
|
<div class="block">Write this histogram to the given out stream.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
|
|
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a name="Histogram()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>Histogram</h4>
|
|
<pre>public Histogram()</pre>
|
|
<div class="block">Construct a new uninitialized histogram. This constructor is for use only
|
|
by object streaming.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="Histogram(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>Histogram</h4>
|
|
<pre>public Histogram(int B)</pre>
|
|
<div class="block">Construct a new histogram with the given number of bins.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>B</code> - Number of bins (≥ 2).</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - (unchecked exception) Thrown if <TT>B</TT> < 2.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="Histogram(edu.rit.numeric.Histogram)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>Histogram</h4>
|
|
<pre>public Histogram(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</pre>
|
|
<div class="block">Construct a new histogram that is a deep copy of the given histogram.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>hist</code> - Histogram to copy.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="clear()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>clear</h4>
|
|
<pre>public void clear()</pre>
|
|
<div class="block">Clear this histogram. All the bin counts are set to zero.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="copy(edu.rit.numeric.Histogram)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>copy</h4>
|
|
<pre>public <a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> copy(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</pre>
|
|
<div class="block">Make this histogram be a deep copy of the given histogram.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>hist</code> - Histogram to copy.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This histogram.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="clone()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>clone</h4>
|
|
<pre>public <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> clone()</pre>
|
|
<div class="block">Create a clone of this histogram.</div>
|
|
<dl>
|
|
<dt><strong>Overrides:</strong></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a></code> in class <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Clone.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="size()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>size</h4>
|
|
<pre>public int size()</pre>
|
|
<div class="block">Returns the number of bins in this histogram.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Number of bins.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="accumulate(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>accumulate</h4>
|
|
<pre>public void accumulate(int x)</pre>
|
|
<div class="block">Accumulate the given value of type <TT>int</TT> into this histogram.
|
|
<P>
|
|
The base class implementation of the <TT>accumulate()</TT> method
|
|
increments bin number <TT>x</TT>. A subclass may override this method to
|
|
increment some other bin number.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../edu/rit/numeric/Histogram.html#increment(int)"><code>increment(int)</code></a></dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="accumulate(long)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>accumulate</h4>
|
|
<pre>public void accumulate(long x)</pre>
|
|
<div class="block">Accumulate the given value of type <TT>long</TT> into this histogram.
|
|
<P>
|
|
The base class implementation of the <TT>accumulate()</TT> method throws
|
|
an UnsupportedOperationException. If long values are to be accumulated, a
|
|
subclass must override this method to increment the proper bin number.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../edu/rit/numeric/Histogram.html#increment(int)"><code>increment(int)</code></a></dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="accumulate(float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>accumulate</h4>
|
|
<pre>public void accumulate(float x)</pre>
|
|
<div class="block">Accumulate the given value of type <TT>float</TT> into this histogram.
|
|
<P>
|
|
The base class implementation of the <TT>accumulate()</TT> method throws
|
|
an UnsupportedOperationException. If float values are to be accumulated,
|
|
a subclass must override this method to increment the proper bin number.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../edu/rit/numeric/Histogram.html#increment(int)"><code>increment(int)</code></a></dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="accumulate(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>accumulate</h4>
|
|
<pre>public void accumulate(double x)</pre>
|
|
<div class="block">Accumulate the given value of type <TT>double</TT> into this histogram.
|
|
<P>
|
|
The base class implementation of the <TT>accumulate()</TT> method throws
|
|
an UnsupportedOperationException. If double values are to be accumulated,
|
|
a subclass must override this method to increment the proper bin number.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../edu/rit/numeric/Histogram.html#increment(int)"><code>increment(int)</code></a></dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="accumulate(java.lang.Object)">
|
|
<!-- -->
|
|
</a><a name="accumulate(T)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>accumulate</h4>
|
|
<pre>public <T> void accumulate(T x)</pre>
|
|
<div class="block">Accumulate the given object of type <TT>T</TT> into this histogram.
|
|
<P>
|
|
The base class implementation of the <TT>accumulate()</TT> method throws
|
|
an UnsupportedOperationException. If objects are to be accumulated, a
|
|
subclass must override this method to increment the proper bin number.</div>
|
|
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Object data type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../edu/rit/numeric/Histogram.html#increment(int)"><code>increment(int)</code></a></dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="count(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>count</h4>
|
|
<pre>public long count(int i)</pre>
|
|
<div class="block">Returns the count in the given bin of this histogram.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - Bin number.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Count in bin <TT>i</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="prob(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>prob</h4>
|
|
<pre>public double prob(int i)</pre>
|
|
<div class="block">Returns the observed probability of incrementing the count in the given
|
|
bin of this histogram. This method returns <a href="../../../edu/rit/numeric/Histogram.html#count(int)"><code>count(i)</code></a>/<a href="../../../edu/rit/numeric/Histogram.html#total()"><code>total()</code></a>.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - Bin number.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Observed probability for bin <TT>i</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="total()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>total</h4>
|
|
<pre>public long total()</pre>
|
|
<div class="block">Returns the total count in all bins of this histogram.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Total count.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="expectedCount(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>expectedCount</h4>
|
|
<pre>public double expectedCount(int i)</pre>
|
|
<div class="block">Determine the expected count in the given bin for a chi-square test. This
|
|
method returns <a href="../../../edu/rit/numeric/Histogram.html#expectedProb(int)"><code>expectedProb(i)</code></a>*<a href="../../../edu/rit/numeric/Histogram.html#total()"><code>total()</code></a>.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - Bin number.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Expected count in bin <TT>i</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="expectedProb(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>expectedProb</h4>
|
|
<pre>public double expectedProb(int i)</pre>
|
|
<div class="block">Determine the expected probability of incrementing the given bin for a
|
|
chi-square test.
|
|
<P>
|
|
The base class implementation of this method assumes that the bin counts
|
|
are supposed to be all the same; thus, the expected probability for each
|
|
bin is the reciprocal of the number of bins. A subclass can override this
|
|
method to return different expected probabilities.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - Bin number.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Expected probability for bin <TT>i</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="chisqr()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>chisqr</h4>
|
|
<pre>public double chisqr()</pre>
|
|
<div class="block">Returns the chi-square statistic for this histogram. The expected count
|
|
in bin <I>i</I> is determined by calling the <a href="../../../edu/rit/numeric/Histogram.html#expectedCount(int)"><code>expectedCount(i)</code></a> method.</div>
|
|
<dl><dt><span class="strong">Returns:</span></dt><dd>Chi-square statistic.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="pvalue(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>pvalue</h4>
|
|
<pre>public double pvalue(double chisqr)</pre>
|
|
<div class="block">Returns the p-value of the given chi-square statistic for this histogram.
|
|
The chi-square statistic is assumed to obey the chi-square distribution
|
|
with <I>B</I>−1 degrees of freedom, where <I>B</I> is the number of
|
|
bins.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>chisqr</code> - Chi-square statistic.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>P-value of <TT>chisqr</TT>.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="add(edu.rit.numeric.Histogram)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>add</h4>
|
|
<pre>public void add(<a href="../../../edu/rit/numeric/Histogram.html" title="class in edu.rit.numeric">Histogram</a> hist)</pre>
|
|
<div class="block">Add the given histogram to this histogram. The count in each bin of
|
|
<TT>hist</TT> is added to the count in the corresponding bin of this
|
|
histogram. The histograms must have the same number of bins.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>hist</code> - Histogram to add.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - (unchecked exception) Thrown if <TT>hist</TT> does not have the same
|
|
number of bins as this histogram.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="writeOut(edu.rit.io.OutStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>writeOut</h4>
|
|
<pre>public void writeOut(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Write this histogram to the given out stream.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)">writeOut</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - Out stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="readIn(edu.rit.io.InStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>readIn</h4>
|
|
<pre>public void readIn(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Read this histogram from the given in stream.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)">readIn</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - In stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="increment(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>increment</h4>
|
|
<pre>protected void increment(int i)</pre>
|
|
<div class="block">Increment the given bin in this histogram. The subclass of class
|
|
Histogram determines the manner in which values are categorized into
|
|
bins.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - Bin number.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar_bottom">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Histogram.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/numeric/Int96.html" title="class in edu.rit.numeric"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/numeric/Histogram.html" target="_top">Frames</a></li>
|
|
<li><a href="Histogram.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small><FONT SIZE="-2">Copyright © 2013–2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">@</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
|
|
</body>
|
|
</html>
|