Portfolio Code | Clement Colmerauer
Repositories
Site
Rabbit simulation
Code
Commits
Branches
Tags
Search
Tree:
a20104a
Branches
Tags
master
Rabbit simulation
build
colt
doc
api
hep
aida
bin
QuantileBin1D.html
initial commit
Clement COLMERAUER
commited
a20104a
at 2024-09-09 10:17:52
QuantileBin1D.html
Blame
History
Raw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_05) on Thu Sep 09 20:36:14 PDT 2004 --> <TITLE> QuantileBin1D (Colt 1.2.0 - API Specification) </TITLE> <META NAME="keywords" CONTENT="hep.aida.bin.QuantileBin1D class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="QuantileBin1D (Colt 1.2.0 - API Specification)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/QuantileBin1D.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin"><B>PREV CLASS</B></A> <A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="QuantileBin1D.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_cern.colt.PersistentObject">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> hep.aida.bin</FONT> <BR> Class QuantileBin1D</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../cern/colt/PersistentObject.html" title="class in cern.colt">cern.colt.PersistentObject</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../hep/aida/bin/AbstractBin.html" title="class in hep.aida.bin">hep.aida.bin.AbstractBin</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../hep/aida/bin/AbstractBin1D.html" title="class in hep.aida.bin">hep.aida.bin.AbstractBin1D</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin">hep.aida.bin.StaticBin1D</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">hep.aida.bin.MightyStaticBin1D</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>hep.aida.bin.QuantileBin1D</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Cloneable.html" title="class or interface in java.lang">Cloneable</A>, <A HREF="../../../cern/colt/buffer/DoubleBufferConsumer.html" title="interface in cern.colt.buffer">DoubleBufferConsumer</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A></DD> </DL> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../hep/aida/bin/DynamicBin1D.html" title="class in hep.aida.bin">DynamicBin1D</A></DD> </DL> <HR> <DL> <DT>public class <B>QuantileBin1D</B><DT>extends <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></DL> <P> 1-dimensional non-rebinnable bin holding <tt>double</tt> elements with scalable quantile operations defined upon; Using little main memory, quickly computes approximate quantiles over very large data sequences with and even without a-priori knowledge of the number of elements to be filled; Conceptually a strongly lossily compressed multiset (or bag); Guarantees to respect the worst case approximation error specified upon instance construction. First see the <a href="package-summary.html">package summary</a> and javadoc <a href="package-tree.html">tree view</a> to get the broad picture. <p> <b>Motivation and Problem:</b> Intended to help scale applications requiring quantile computation. Quantile computation on very large data sequences is problematic, for the following reasons: Computing quantiles requires sorting the data sequence. To sort a data sequence the entire data sequence needs to be available. Thus, data cannot be thrown away during filling (as done by static bins like <A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin"><CODE>StaticBin1D</CODE></A> and <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin"><CODE>MightyStaticBin1D</CODE></A>). It needs to be kept, either in main memory or on disk. There is often not enough main memory available. Thus, during filling data needs to be streamed onto disk. Sorting disk resident data is prohibitively time consuming. As a consequence, traditional methods either need very large memories (like <A HREF="../../../hep/aida/bin/DynamicBin1D.html" title="class in hep.aida.bin"><CODE>DynamicBin1D</CODE></A>) or time consuming disk based sorting. <p> This class proposes to efficiently solve the problem, at the expense of producing approximate rather than exact results. It can deal with infinitely many elements without resorting to disk. The main memory requirements are smaller than for any other known approximate technique by an order of magnitude. They get even smaller if an upper limit on the maximum number of elements ever to be added is known a-priori. <p> <b>Approximation error:</b> The approximation guarantees are parametrizable and explicit but probabilistic, and apply for arbitrary value distributions and arrival distributions of the data sequence. In other words, this class guarantees to respect the worst case approximation error specified upon instance construction to a certain probability. Of course, if it is specified that the approximation error should not exceed some number <i>very close</i> to zero, this class will potentially consume just as much memory as any of the traditional exact techniques would do. However, for errors larger than 10<sup>-5</sup>, its memory requirements are modest, as shown by the table below. <p> <b>Main memory requirements:</b> Given in megabytes, assuming a single element (<tt>double</tt>) takes 8 byte. The number of elements required is then <tt>MB*1024*1024/8</tt>. <p> <b>Parameters:</b> <ul> <li><i>epsilon</i> - the maximum allowed approximation error on quantiles; in <tt>[0.0,1.0]</tt>. To get exact rather than approximate quantiles, set <tt>epsilon=0.0</tt>; <li><i>delta</i> - the probability allowed that the approximation error fails to be smaller than epsilon; in <tt>[0.0,1.0]</tt>. To avoid probabilistic answers, set <tt>delta=0.0</tt>. For example, <tt>delta = 0.0001</tt> is equivalent to a confidence of <tt>99.99%</tt>. <li><i>quantiles</i> - the number of quantiles to be computed; in <tt>[0,Integer.MAX_VALUE]</tt>. <li><i>is N known?</i> - specifies whether the exact size of the dataset over which quantiles are to be computed is known. <li>N<sub>max</sub> - the exact dataset size, if known. Otherwise, an upper limit on the dataset size. If no upper limit is known set to infinity (<tt>Long.MAX_VALUE</tt>). </ul> N<sub>max</sub>=inf - we are sure that exactly (<i>known</i>) or less than (<i>unknown</i>) infinity elements will be added. <br>N<sub>max</sub>=10<sup>6</sup> - we are sure that exactly (<i>known</i>) or less than (<i>unknown</i>) 10<sup>6</sup> elements will be added. <br>N<sub>max</sub>=10<sup>7</sup> - we are sure that exactly (<i>known</i>) or less than (<i>unknown</i>) 10<sup>7</sup> elements will be added. <br>N<sub>max</sub>=10<sup>8</sup> - we are sure that exactly (<i>known</i>) or less than (<i>unknown</i>) 10<sup>8</sup> elements will be added. <p> <table width="75%" border="1" cellpadding="6" cellspacing="0" align="center"> <tr align="center" valign="middle"> <td width="20%" nowrap colspan="13" bgcolor="#33CC66"><font color="#000000"></font> <div align="center"><font color="#000000" size="5">Required main memory [MB]</font></div> </td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap rowspan="2" bgcolor="#FF9966"><font color="#000000">#quantiles</font></td> <td width="6%" nowrap rowspan="2" bgcolor="#FF9966"> <div align="center"></div> <div align="center"></div> <div align="center"><font color="#000000">epsilon</font></div> </td> <td width="6%" nowrap rowspan="2" bgcolor="#FF9966"><font color="#000000">delta</font></td> <td width="1%" nowrap rowspan="31"> </td> <td nowrap colspan="4" bgcolor="#FF9966"><font color="#000000">N unknown</font></td> <td width="1%" nowrap align="center" valign="middle" bgcolor="#C0C0C0" rowspan="31"><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font></td> <td nowrap colspan="4" bgcolor="#FF9966"><font color="#000000">N known</font></td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=inf</font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>6</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>7</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>8</sup></font></td> <td width="8%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=inf</font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>6</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>7</sup></font></td> <td width="19%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>8</sup></font></td> </tr> <tr align="center" valign="middle"> <td nowrap bgcolor="#C0C0C0" colspan="3"><font color="#000000"></font> <div align="center"></div> <font color="#000000"></font></td> <td nowrap colspan="4"> </td> <td nowrap colspan="4"> </td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap bgcolor="#FFCCCC"><font color="#000000">any</font></td> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">0</font></div> </td> <td width="6%" nowrap bgcolor="#FFCCCC"><font color="#000000">any</font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">infinity</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">7.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">76</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">762</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">infinity</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">7.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">76</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">762</font></td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap rowspan="6" bgcolor="#FFCCCC"><font color="#000000">any</font></td> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -1</sup></font></div> </td> <td width="6%" nowrap rowspan="6" bgcolor="#FFCCCC"><font color="#000000">0</font></td> <td width="7%" nowrap rowspan="6" bgcolor="#66CCFF"><font color="#000000">infinity</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.003</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.005</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.006</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.003</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.005</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.006</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -2</sup></font></div> </td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.05</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.31</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.05</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -3</sup></font></div> </td> <td width="9%" nowrap align="center" valign="middle" bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap align="center" valign="middle" bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="9%" nowrap align="center" valign="middle" bgcolor="#66CCFF"><font color="#000000">0.3</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">2.7</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -4</sup></font></div> </td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">26.9</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -5</sup></font></div> </td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">205</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"> <div align="center"><font color="#000000">10<sup> -6</sup></font></div> </td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">7.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">25.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">63.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">1758</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">7.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">25.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">63.6</font></td> </tr> <tr align="center" valign="middle"> <td nowrap bgcolor="#C0C0C0" colspan="3"><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font></td> <td nowrap colspan="4"> </td> <td nowrap colspan="4"> </td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap bgcolor="#FFCCCC" rowspan="8"><font color="#000000">100</font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -2</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.033</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.021</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.038</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.021</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.04</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.024</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.020</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -3</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.48</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.32</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.54</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.37</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -4</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">6.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">4.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">7.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">5.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.6</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -5</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">86</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">63</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">94</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">70</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> </tr> <tr align="center" valign="middle"> <td nowrap bgcolor="#C0C0C0" colspan="3"><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font></td> <td nowrap colspan="4"> </td> <td nowrap colspan="4"> </td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="8"><font color="#000000">10000</font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font><font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -2</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.04</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.04</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.04</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.04</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.02</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.03</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -3</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.52</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.21</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.35</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.21</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">0.56</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.21</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">0.38</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.12</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.21</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">0.3</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -4</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">7.0</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.64</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">5.0</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.64</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">7.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.64</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">5.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">0.64</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">1.2</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">2.1</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC" rowspan="2"> <div align="center"><font color="#000000">10<sup> -5</sup></font></div> <font color="#000000"></font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -1</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">90</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">67</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> </tr> <tr align="center" valign="middle"> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FFCCCC"><font color="#000000">10<sup> -5</sup></font></td> <td width="7%" nowrap bgcolor="#66CCFF"><font color="#000000">96</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> <td width="8%" nowrap bgcolor="#66CCFF"><font color="#000000">71</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">2.5</font></td> <td width="9%" nowrap bgcolor="#66CCFF"><font color="#000000">6.4</font></td> <td width="19%" nowrap bgcolor="#66CCFF"><font color="#000000">11.6</font></td> </tr> <tr align="center" valign="middle"> <td width="19%" nowrap align="center" valign="middle" colspan="3"> </td> <td width="34%" nowrap colspan="4"> </td> <td width="45%" nowrap colspan="4"> </td> </tr> <tr align="center" valign="middle"> <td width="7%" nowrap align="center" valign="middle" bgcolor="#FF9966" rowspan="2"><font color="#000000">#quantiles</font></td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FF9966" rowspan="2">epsilon</td> <td width="6%" nowrap align="center" valign="middle" bgcolor="#FF9966" rowspan="2">delta</td> <td width="7%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=inf</font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>6</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>7</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>8</sup></font></td> <td width="7%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=inf</font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>6</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>7</sup></font></td> <td width="9%" nowrap bgcolor="#FF9966"><font color="#000000">N<sub>max</sub>=10<sup>8</sup></font></td> </tr> <tr align="center" valign="middle"> <td nowrap colspan="4" bgcolor="#FF9966"><font color="#000000">N unknown</font></td> <td nowrap colspan="4" bgcolor="#FF9966"><font color="#000000">N known</font></td> </tr> <tr align="center" valign="middle"> <td width="20%" nowrap align="center" valign="middle" colspan="13" bgcolor="#33CC66"><font color="#000000" size="5">Required main memory [MB]</font></td> </tr> </table> <p> <b>Implementation:</b> <p> After: Gurmeet Singh Manku, Sridhar Rajagopalan and Bruce G. Lindsay, Random Sampling Techniques for Space Efficient Online Computation of Order Statistics of Large Datasets. Proc. of the 1999 ACM SIGMOD Int. Conf. on Management of Data, Paper available <A HREF="http://www-cad.eecs.berkeley.edu/~manku/papers/unknown.ps.gz"> here</A>. <p> and <p> Gurmeet Singh Manku, Sridhar Rajagopalan and Bruce G. Lindsay, Approximate Medians and other Quantiles in One Pass and with Limited Memory, Proc. of the 1998 ACM SIGMOD Int. Conf. on Management of Data, Paper available <A HREF="http://www-cad.eecs.berkeley.edu/~manku/papers/quantiles.ps.gz"> here</A>. <p> The broad picture is as follows. Two concepts are used: <i>Shrinking</i> and <i>Sampling</i>. Shrinking takes a data sequence, sorts it and produces a shrinked data sequence by picking every k-th element and throwing away all the rest. The shrinked data sequence is an approximation to the original data sequence. <p> Imagine a large data sequence (residing on disk or being generated in memory on the fly) and a main memory <i>block</i> of <tt>n=b*k</tt> elements (<tt>b</tt> is the number of buffers, <tt>k</tt> is the number of elements per buffer). Fill elements from the data sequence into the block until it is full or the data sequence is exhausted. When the block (or a subset of buffers) is full and the data sequence is not exhausted, apply shrinking to lossily compress a number of buffers into one single buffer. Repeat these steps until all elements of the data sequence have been consumed. Now the block is a shrinked approximation of the original data sequence. Treating it as if it would be the original data sequence, we can determine quantiles in main memory. <p> Now, the whole thing boils down to the question of: Can we choose <tt>b</tt> and <tt>k</tt> (the number of buffers and the buffer size) such that <tt>b*k</tt> is minimized, yet quantiles determined upon the block are <i>guaranteed</i> to be away from the true quantiles no more than some <tt>epsilon</tt>? It turns out, we can. It also turns out that the required main memory block size <tt>n=b*k</tt> is usually moderate (see the table above). <p> The theme can be combined with random sampling to further reduce main memory requirements, at the expense of probabilistic guarantees. Sampling filters the data sequence and feeds only selected elements to the algorithm outlined above. Sampling is turned on or off, depending on the parametrization. <p> This quick overview does not go into important details, such as assigning proper <i>weights</i> to buffers, how to choose subsets of buffers to shrink, etc. For more information consult the papers cited above. <p> <b>Time Performance:</b> <p> <div align="center">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic,<br> filling 10 <sup>4</sup> elements at a time, reading 100 percentiles at a time,<br> hasSumOfLogarithms()=false, hasSumOfInversions()=false, getMaxOrderForSumOfPowers()=2<br> </div> <center> <table border cellpadding="6" cellspacing="0" align="center" width="623"> <tr valign="middle"> <td align="center" height="50" colspan="9" bgcolor="#33CC66" nowrap> <font size="5">Performance</font></td> </tr> <tr valign="middle"> <td align="center" width="56" height="100" rowspan="2" bgcolor="#FF9966" nowrap> Quantiles</td> <td align="center" width="44" height="100" rowspan="2" bgcolor="#FF9966" nowrap> Epsilon</td> <td align="center" width="32" height="100" rowspan="2" bgcolor="#FF9966" nowrap> Delta</td> <td align="center" width="1" height="150" rowspan="7" nowrap> </td> <td align="center" height="50" colspan="2" bgcolor="#33CC66" nowrap> <font size="5">Filling</font> <br> [#elements/sec] </td> <td align="center" width="1" height="150" rowspan="7" nowrap> </td> <td align="center" height="50" colspan="2" bgcolor="#33CC66"> <font size="5">Quantile computation</font><br> [#quantiles/sec] </td> </tr> <tr valign="middle" bgcolor="#FF9966" nowrap> <td align="center" width="75" height="50" nowrap valign="middle"> <font color="#000000">N unknown,<br> N<sub>max</sub>=inf</font></td> <td align="center" width="77" height="50" nowrap valign="middle"> <font color="#000000">N known,<br> N<sub>max</sub>=10<sup>7</sup></font> </td> <td align="center" width="106" height="50" nowrap valign="middle"> <font color="#000000">N unknown,<br> N<sub>max</sub>=inf</font></td> <td align="center" width="103" height="50" nowrap valign="middle"> <font color="#000000">N known,<br> N<sub>max</sub>=10<sup>7</sup></font> </td> </tr> <tr valign="middle"> <td align="center" height="31" colspan="3" nowrap> </td> <td align="center" height="31" colspan="2" nowrap> </td> <td align="center" height="31" colspan="2" nowrap> </td> </tr> <tr valign="middle"> <td align="center" width="56" rowspan="4" bgcolor="#FFCCCC" nowrap> 10<sup>4</sup></td> <td align="center" width="44" bgcolor="#FFCCCC" nowrap> 10 <sup> -1</sup></td> <td align="center" width="32" bgcolor="#FFCCCC" nowrap rowspan="4"> 10 <sup> -1</sup> </td> <td width="75" bgcolor="#66CCFF" nowrap align="center"> <p>1600000</p> </td> <td width="77" bgcolor="#66CCFF" nowrap align="center">1300000</td> <td align="center" width="106" bgcolor="#66CCFF" nowrap>250000 </td> <td align="center" width="103" bgcolor="#66CCFF" nowrap>130000 </td> </tr> <tr valign="middle"> <td align="center" width="44" bgcolor="#FFCCCC"> 10 <sup> -2</sup></td> <td width="75" bgcolor="#66CCFF" align="center">360000</td> <td width="77" bgcolor="#66CCFF" align="center">1200000</td> <td align="center" width="106" bgcolor="#66CCFF">50000 </td> <td align="center" width="103" bgcolor="#66CCFF">20000 </td> </tr> <tr valign="middle"> <td align="center" width="44" bgcolor="#FFCCCC"> 10 <sup> -3</sup></td> <td width="75" bgcolor="#66CCFF" align="center">150000</td> <td width="77" bgcolor="#66CCFF" align="center">200000</td> <td align="center" width="106" bgcolor="#66CCFF">3600 </td> <td align="center" width="103" bgcolor="#66CCFF">3000 </td> </tr> <tr valign="middle"> <td align="center" width="44" bgcolor="#FFCCCC"> 10 <sup> -4</sup></td> <td width="75" bgcolor="#66CCFF" align="center">120000</td> <td width="77" bgcolor="#66CCFF" align="center">170000</td> <td align="center" width="106" bgcolor="#66CCFF">80 </td> <td align="center" width="103" bgcolor="#66CCFF">1000 </td> </tr> </table> </center> <P> <P> <DL> <DT><B>Version:</B></DT> <DD>0.9, 03-Jul-99</DD> <DT><B>See Also:</B><DD><A HREF="../../../cern/jet/stat/quantile/package-summary.html"><CODE>cern.jet.stat.quantile</CODE></A>, <A HREF="../../../serialized-form.html#hep.aida.bin.QuantileBin1D">Serialized Form</A></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_cern.colt.PersistentObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class cern.colt.<A HREF="../../../cern/colt/PersistentObject.html" title="class in cern.colt">PersistentObject</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../cern/colt/PersistentObject.html#serialVersionUID">serialVersionUID</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#QuantileBin1D(boolean, long, double, double, int, cern.jet.random.engine.RandomEngine)">QuantileBin1D</A></B>(boolean known_N, long N, double epsilon, double delta, int quantiles, <A HREF="../../../cern/jet/random/engine/RandomEngine.html" title="class in cern.jet.random.engine">RandomEngine</A> randomGenerator)</CODE> <BR> Equivalent to <tt>new QuantileBin1D(known_N, N, epsilon, delta, quantiles, randomGenerator, false, false, 2)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#QuantileBin1D(boolean, long, double, double, int, cern.jet.random.engine.RandomEngine, boolean, boolean, int)">QuantileBin1D</A></B>(boolean known_N, long N, double epsilon, double delta, int quantiles, <A HREF="../../../cern/jet/random/engine/RandomEngine.html" title="class in cern.jet.random.engine">RandomEngine</A> randomGenerator, boolean hasSumOfLogarithms, boolean hasSumOfInversions, int maxOrderForSumOfPowers)</CODE> <BR> Constructs and returns an empty bin that, under the given constraints, minimizes the amount of memory needed.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#QuantileBin1D(double)">QuantileBin1D</A></B>(double epsilon)</CODE> <BR> Equivalent to <tt>new QuantileBin1D(false, Long.MAX_VALUE, epsilon, 0.001, 10000, new cern.jet.random.engine.DRand(new java.util.Date())</tt>.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#addAllOfFromTo(cern.colt.list.DoubleArrayList, int, int)">addAllOfFromTo</A></B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> list, int from, int to)</CODE> <BR> Adds the part of the specified list between indexes <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) to the receiver.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#clear()">clear</A></B>()</CODE> <BR> Removes all elements from the receiver.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#clone()">clone</A></B>()</CODE> <BR> Returns a deep copy of the receiver.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#compareWith(hep.aida.bin.AbstractBin1D)">compareWith</A></B>(<A HREF="../../../hep/aida/bin/AbstractBin1D.html" title="class in hep.aida.bin">AbstractBin1D</A> other)</CODE> <BR> Computes the deviations from the receiver's measures to another bin's measures.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#median()">median</A></B>()</CODE> <BR> Returns the median.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#quantile(double)">quantile</A></B>(double phi)</CODE> <BR> Computes and returns the phi-quantile.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#quantileInverse(double)">quantileInverse</A></B>(double element)</CODE> <BR> Returns how many percent of the elements contained in the receiver are <tt><= element</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#quantiles(cern.colt.list.DoubleArrayList)">quantiles</A></B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> phis)</CODE> <BR> Returns the quantiles of the specified percentages.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#sizeOfRange(double, double)">sizeOfRange</A></B>(double minElement, double maxElement)</CODE> <BR> Returns how many elements are contained in the range <tt>[minElement,maxElement]</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A>[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#splitApproximately(cern.colt.list.DoubleArrayList, int)">splitApproximately</A></B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> percentages, int k)</CODE> <BR> Divides (rebins) a copy of the receiver at the given <i>percentage boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A>[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#splitApproximately(hep.aida.IAxis, int)">splitApproximately</A></B>(<A HREF="../../../hep/aida/IAxis.html" title="interface in hep.aida">IAxis</A> axis, int k)</CODE> <BR> Divides (rebins) a copy of the receiver at the given <i>interval boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../hep/aida/bin/QuantileBin1D.html#toString()">toString</A></B>()</CODE> <BR> Returns a String representation of the receiver.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_hep.aida.bin.MightyStaticBin1D"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class hep.aida.bin.<A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#geometricMean()">geometricMean</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#getMaxOrderForSumOfPowers()">getMaxOrderForSumOfPowers</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#getMinOrderForSumOfPowers()">getMinOrderForSumOfPowers</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#harmonicMean()">harmonicMean</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#hasSumOfInversions()">hasSumOfInversions</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#hasSumOfLogarithms()">hasSumOfLogarithms</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#hasSumOfPowers(int)">hasSumOfPowers</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#kurtosis()">kurtosis</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#moment(int, double)">moment</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#product()">product</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#skew()">skew</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfInversions()">sumOfInversions</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfLogarithms()">sumOfLogarithms</A>, <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfPowers(int)">sumOfPowers</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_hep.aida.bin.StaticBin1D"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class hep.aida.bin.<A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin">StaticBin1D</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../hep/aida/bin/StaticBin1D.html#add(double)">add</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#isRebinnable()">isRebinnable</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#max()">max</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#min()">min</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#size()">size</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#sum()">sum</A>, <A HREF="../../../hep/aida/bin/StaticBin1D.html#sumOfSquares()">sumOfSquares</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_hep.aida.bin.AbstractBin1D"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class hep.aida.bin.<A HREF="../../../hep/aida/bin/AbstractBin1D.html" title="class in hep.aida.bin">AbstractBin1D</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../hep/aida/bin/AbstractBin1D.html#addAllOf(cern.colt.list.DoubleArrayList)">addAllOf</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#buffered(int)">buffered</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#mean()">mean</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#rms()">rms</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#standardDeviation()">standardDeviation</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#standardError()">standardError</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#trimToSize()">trimToSize</A>, <A HREF="../../../hep/aida/bin/AbstractBin1D.html#variance()">variance</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_hep.aida.bin.AbstractBin"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class hep.aida.bin.<A HREF="../../../hep/aida/bin/AbstractBin.html" title="class in hep.aida.bin">AbstractBin</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../hep/aida/bin/AbstractBin.html#center()">center</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#center(int)">center</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#error()">error</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#error(int)">error</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#offset()">offset</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#offset(int)">offset</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#value()">value</A>, <A HREF="../../../hep/aida/bin/AbstractBin.html#value(int)">value</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="QuantileBin1D(double)"><!-- --></A><H3> QuantileBin1D</H3> <PRE> public <B>QuantileBin1D</B>(double epsilon)</PRE> <DL> <DD>Equivalent to <tt>new QuantileBin1D(false, Long.MAX_VALUE, epsilon, 0.001, 10000, new cern.jet.random.engine.DRand(new java.util.Date())</tt>. <P> </DL> <HR> <A NAME="QuantileBin1D(boolean, long, double, double, int, cern.jet.random.engine.RandomEngine)"><!-- --></A><H3> QuantileBin1D</H3> <PRE> public <B>QuantileBin1D</B>(boolean known_N, long N, double epsilon, double delta, int quantiles, <A HREF="../../../cern/jet/random/engine/RandomEngine.html" title="class in cern.jet.random.engine">RandomEngine</A> randomGenerator)</PRE> <DL> <DD>Equivalent to <tt>new QuantileBin1D(known_N, N, epsilon, delta, quantiles, randomGenerator, false, false, 2)</tt>. <P> </DL> <HR> <A NAME="QuantileBin1D(boolean, long, double, double, int, cern.jet.random.engine.RandomEngine, boolean, boolean, int)"><!-- --></A><H3> QuantileBin1D</H3> <PRE> public <B>QuantileBin1D</B>(boolean known_N, long N, double epsilon, double delta, int quantiles, <A HREF="../../../cern/jet/random/engine/RandomEngine.html" title="class in cern.jet.random.engine">RandomEngine</A> randomGenerator, boolean hasSumOfLogarithms, boolean hasSumOfInversions, int maxOrderForSumOfPowers)</PRE> <DL> <DD>Constructs and returns an empty bin that, under the given constraints, minimizes the amount of memory needed. Some applications exactly know in advance over how many elements quantiles are to be computed. Provided with such information the main memory requirements of this class are small. Other applications don't know in advance over how many elements quantiles are to be computed. However, some of them can give an upper limit, which will reduce main memory requirements. For example, if elements are selected from a database and filled into histograms, it is usually not known in advance how many elements are being filled, but one may know that at most <tt>S</tt> elements, the number of elements in the database, are filled. A third type of application knowns nothing at all about the number of elements to be filled; from zero to infinitely many elements may actually be filled. This method efficiently supports all three types of applications. <P> <DT><B>Parameters:</B><DD><CODE>known_N</CODE> - specifies whether the number of elements over which quantiles are to be computed is known or not. <p><DD><CODE>N</CODE> - if <tt>known_N==true</tt>, the number of elements over which quantiles are to be computed. if <tt>known_N==false</tt>, the upper limit on the number of elements over which quantiles are to be computed. In other words, the maximum number of elements ever to be added. If such an upper limit is a-priori unknown, then set <tt>N = Long.MAX_VALUE</tt>. <p><DD><CODE>epsilon</CODE> - the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0 <= epsilon <= 1</tt>). To get exact rather than approximate quantiles, set <tt>epsilon=0.0</tt>; <p><DD><CODE>delta</CODE> - the allowed probability that the actual approximation error exceeds <tt>epsilon</tt> (e.g. 0.0001) (0 <= delta <= 1). To avoid probabilistic answers, set <tt>delta=0.0</tt>. For example, <tt>delta = 0.0001</tt> is equivalent to a confidence of <tt>99.99%</tt>. <p><DD><CODE>quantiles</CODE> - the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles >= 1</tt>). If unknown in advance, set this number large, e.g. <tt>quantiles >= 10000</tt>. <p><DD><CODE>hasSumOfLogarithms</CODE> - Tells whether <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfLogarithms()"><CODE>MightyStaticBin1D.sumOfLogarithms()</CODE></A> can return meaningful results. Set this parameter to <tt>false</tt> if measures of sum of logarithms, geometric mean and product are not required. <p><DD><CODE>hasSumOfInversions</CODE> - Tells whether <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfInversions()"><CODE>MightyStaticBin1D.sumOfInversions()</CODE></A> can return meaningful results. Set this parameter to <tt>false</tt> if measures of sum of inversions, harmonic mean and sumOfPowers(-1) are not required. <p><DD><CODE>maxOrderForSumOfPowers</CODE> - The maximum order <tt>k</tt> for which <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#sumOfPowers(int)"><CODE>MightyStaticBin1D.sumOfPowers(int)</CODE></A> can return meaningful results. Set this parameter to at least 3 if the skew is required, to at least 4 if the kurtosis is required. In general, if moments are required set this parameter at least as large as the largest required moment. This method always substitutes <tt>Math.max(2,maxOrderForSumOfPowers)</tt> for the parameter passed in. Thus, <tt>sumOfPowers(0..2)</tt> always returns meaningful results.</DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="addAllOfFromTo(cern.colt.list.DoubleArrayList, int, int)"><!-- --></A><H3> addAllOfFromTo</H3> <PRE> public void <B>addAllOfFromTo</B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> list, int from, int to)</PRE> <DL> <DD>Adds the part of the specified list between indexes <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) to the receiver. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#addAllOfFromTo(cern.colt.list.DoubleArrayList, int, int)">addAllOfFromTo</A></CODE> in class <CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>list</CODE> - the list of which elements shall be added.<DD><CODE>from</CODE> - the index of the first element to be added (inclusive).<DD><CODE>to</CODE> - the index of the last element to be added (inclusive). <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang">IndexOutOfBoundsException</A></CODE> - if <tt>list.size()>0 && (from<0 || from>to || to>=list.size())</tt>.</DL> </DD> </DL> <HR> <A NAME="clear()"><!-- --></A><H3> clear</H3> <PRE> public void <B>clear</B>()</PRE> <DL> <DD>Removes all elements from the receiver. The receiver will be empty after this call returns. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../hep/aida/bin/StaticBin1D.html#clear()">clear</A></CODE> in class <CODE><A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin">StaticBin1D</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="clone()"><!-- --></A><H3> clone</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>clone</B>()</PRE> <DL> <DD>Returns a deep copy of the receiver. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#clone()">clone</A></CODE> in class <CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>a deep copy of the receiver.</DL> </DD> </DL> <HR> <A NAME="compareWith(hep.aida.bin.AbstractBin1D)"><!-- --></A><H3> compareWith</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>compareWith</B>(<A HREF="../../../hep/aida/bin/AbstractBin1D.html" title="class in hep.aida.bin">AbstractBin1D</A> other)</PRE> <DL> <DD>Computes the deviations from the receiver's measures to another bin's measures. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#compareWith(hep.aida.bin.AbstractBin1D)">compareWith</A></CODE> in class <CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>other</CODE> - the other bin to compare with <DT><B>Returns:</B><DD>a summary of the deviations.</DL> </DD> </DL> <HR> <A NAME="median()"><!-- --></A><H3> median</H3> <PRE> public double <B>median</B>()</PRE> <DL> <DD>Returns the median. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="quantile(double)"><!-- --></A><H3> quantile</H3> <PRE> public double <B>quantile</B>(double phi)</PRE> <DL> <DD>Computes and returns the phi-quantile. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>phi</CODE> - the percentage for which the quantile is to be computed. phi must be in the interval <tt>(0.0,1.0]</tt>. <DT><B>Returns:</B><DD>the phi quantile element.</DL> </DD> </DL> <HR> <A NAME="quantileInverse(double)"><!-- --></A><H3> quantileInverse</H3> <PRE> public double <B>quantileInverse</B>(double element)</PRE> <DL> <DD>Returns how many percent of the elements contained in the receiver are <tt><= element</tt>. Does linear interpolation if the element is not contained but lies in between two contained elements. <P> <DD><DL> <DT><B>Returns:</B><DD>the percentage <tt>phi</tt> of elements <tt><= element</tt> (<tt>0.0 <= phi <=1.0)</tt>.</DL> </DD> </DL> <HR> <A NAME="quantiles(cern.colt.list.DoubleArrayList)"><!-- --></A><H3> quantiles</H3> <PRE> public <A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> <B>quantiles</B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> phis)</PRE> <DL> <DD>Returns the quantiles of the specified percentages. For implementation reasons considerably more efficient than calling <A HREF="../../../hep/aida/bin/QuantileBin1D.html#quantile(double)"><CODE>quantile(double)</CODE></A> various times. <P> <DD><DL> <DT><B>Returns:</B><DD>the quantiles.</DL> </DD> </DL> <HR> <A NAME="sizeOfRange(double, double)"><!-- --></A><H3> sizeOfRange</H3> <PRE> public int <B>sizeOfRange</B>(double minElement, double maxElement)</PRE> <DL> <DD>Returns how many elements are contained in the range <tt>[minElement,maxElement]</tt>. Does linear interpolation if one or both of the parameter elements are not contained. Returns exact or approximate results, depending on the parametrization of this class or subclasses. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>minElement</CODE> - the minimum element to search for.<DD><CODE>maxElement</CODE> - the maximum element to search for. <DT><B>Returns:</B><DD>the number of elements in the range.</DL> </DD> </DL> <HR> <A NAME="splitApproximately(cern.colt.list.DoubleArrayList, int)"><!-- --></A><H3> splitApproximately</H3> <PRE> public <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A>[] <B>splitApproximately</B>(<A HREF="../../../cern/colt/list/DoubleArrayList.html" title="class in cern.colt.list">DoubleArrayList</A> percentages, int k)</PRE> <DL> <DD>Divides (rebins) a copy of the receiver at the given <i>percentage boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range. The receiver is not physically rebinned (divided); it stays unaffected by this operation. The returned bins are such that <i>if</i> one would have filled elements into multiple bins instead of one single all encompassing bin only, those multiple bins would have <i>approximately</i> the same statistics measures as the one's returned by this method. <p> The <tt>split(...)</tt> methods are particularly well suited for real-time interactive rebinning (the famous "scrolling slider" effect). <p> Passing equi-distant percentages like <tt>(0.0, 0.2, 0.4, 0.6, 0.8, 1.0)</tt> into this method will yield bins of an <i>equi-depth histogram</i>, i.e. a histogram with bin boundaries adjusted such that each bin contains the same number of elements, in this case 20% each. Equi-depth histograms can be useful if, for example, not enough properties of the data to be captured are known a-priori to be able to define reasonable bin boundaries (partitions). For example, when guesses about minimas and maximas are strongly unreliable. Or when chances are that by focussing too much on one particular area other important areas and characters of a data set may be missed. <p> <b>Implementation:</b> <p> The receiver is divided into <tt>s = percentages.size()-1</tt> intervals (bins). For each interval <tt>I</tt>, its minimum and maximum elements are determined based upon quantile computation. Further, each interval <tt>I</tt> is split into <tt>k</tt> equi-percent-distant subintervals (sub-bins). In other words, an interval is split into subintervals such that each subinterval contains the same number of elements. <p> For each subinterval <tt>S</tt>, its minimum and maximum are determined, again, based upon quantile computation. They yield an approximate arithmetic mean <tt>am = (min+max)/2</tt> of the subinterval. A subinterval is treated as if it would contain only elements equal to the mean <tt>am</tt>. Thus, if the subinterval contains, say, <tt>n</tt> elements, it is assumed to consist of <tt>n</tt> mean elements <tt>(am,am,...,am)</tt>. A subinterval's sum of elements, sum of squared elements, sum of inversions, etc. are then approximated using such a sequence of mean elements. <p> Finally, the statistics measures of an interval <tt>I</tt> are computed by summing up (integrating) the measures of its subintervals. <p> <b>Accuracy</b>: <p> Depending on the accuracy of quantile computation and the number of subintervals per interval (the resolution). Objects of this class compute exact or approximate quantiles, depending on the parameters used upon instance construction. Objects of subclasses may <i>always</i> compute exact quantiles, as is the case for <A HREF="../../../hep/aida/bin/DynamicBin1D.html" title="class in hep.aida.bin"><CODE>DynamicBin1D</CODE></A>. Most importantly for this class <tt>QuantileBin1D</tt>, a reasonably small epsilon (e.g. 0.01, perhaps 0.001) should be used upon instance construction. The confidence parameter <tt>delta</tt> is less important, you may find <tt>delta=0.00001</tt> appropriate. <br> The larger the resolution, the smaller the approximation error, up to some limit. Integrating over only a few subintervals per interval will yield very crude approximations. If the resolution is set to a reasonably large number, say 10..100, more small subintervals are integrated, resulting in more accurate results. <br> Note that for good accuracy, the number of quantiles computable with the given approximation guarantees should upon instance construction be specified, so as to satisfy <p> <tt>quantiles > resolution * (percentages.size()-1)</tt> <p> <p> <b>Example:</b> <p> <tt>resolution=2, percentList = (0.0, 0.1, 0.2, 0.5, 0.9, 1.0)</tt> means the receiver is to be split into 5 bins: <br> <ul> <li>bin 0 ranges from <tt>[0%..10%)</tt> and holds the smallest 10% of the sorted elements. <li>bin 1 ranges from <tt>[10%..20%)</tt> and holds the next smallest 10% of the sorted elements. <li>bin 2 ranges from <tt>[20%..50%)</tt> and holds the next smallest 30% of the sorted elements. <li>bin 3 ranges from <tt>[50%..90%)</tt> and holds the next smallest 40% of the sorted elements. <li>bin 4 ranges from <tt>[90%..100%)</tt> and holds the largest 10% of the sorted elements. </ul> <p> The statistics measures for each bin are to be computed at a resolution of 2 subbins per bin. Thus, the statistics measures of a bin are the integrated measures over 2 subbins, each containing the same amount of elements: <ul> <li>bin 0 has a subbin ranging from <tt>[ 0%.. 5%)</tt> and a subbin ranging from <tt>[ 5%..10%)</tt>. <li>bin 1 has a subbin ranging from <tt>[10%..15%)</tt> and a subbin ranging from <tt>[15%..20%)</tt>. <li>bin 2 has a subbin ranging from <tt>[20%..35%)</tt> and a subbin ranging from <tt>[35%..50%)</tt>. <li>bin 3 has a subbin ranging from <tt>[50%..70%)</tt> and a subbin ranging from <tt>[70%..90%)</tt>. <li>bin 4 has a subbin ranging from <tt>[90%..95%)</tt> and a subbin ranging from <tt>[95%..100%)</tt>. </ul> <p> Lets concentrate on the subbins of bin 0. <ul> <li>Assume the subbin <tt>A=[0%..5%)</tt> has a minimum of <tt>300</tt> and a maximum of <tt>350</tt> (0% of all elements are less than 300, 5% of all elements are less than 350). <li>Assume the subbin <tt>B=[5%..10%)</tt> has a minimum of <tt>350</tt> and a maximum of <tt>550</tt> (5% of all elements are less than 350, 10% of all elements are less than 550). </ul> <p> Assume the entire data set consists of <tt>N=100</tt> elements. <ul> <li>Then subbin A has an approximate mean of <tt>300+350 / 2 = 325</tt>, a size of <tt>N*(5%-0%) = 100*5% = 5</tt> elements, an approximate sum of <tt>325 * 100*5% = 1625</tt>, an approximate sum of squares of <tt>325<sup>2</sup> * 100*5% = 528125</tt>, an approximate sum of inversions of <tt>(1.0/325) * 100*5% = 0.015</tt>, etc. <li>Analogously, subbin B has an approximate mean of <tt>350+550 / 2 = 450</tt>, a size of <tt>N*(10%-5%) = 100*5% = 5</tt> elements, an approximate sum of <tt>450 * 100*5% = 2250</tt>, an approximate sum of squares of <tt>450<sup>2</sup> * 100*5% = 1012500</tt>, an approximate sum of inversions of <tt>(1.0/450) * 100*5% = 0.01</tt>, etc. </ul> <p> Finally, the statistics measures of bin 0 are computed by summing up (integrating) the measures of its subintervals: Bin 0 has a size of <tt>N*(10%-0%)=10</tt> elements (we knew that already), sum of <tt>1625+2250=3875</tt>, sum of squares of <tt>528125+1012500=1540625</tt>, sum of inversions of <tt>0.015+0.01=0.025</tt>, etc. From these follow other measures such as <tt>mean=3875/10=387.5, rms = sqrt(1540625 / 10)=392.5</tt>, etc. The other bins are computes analogously. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>percentages</CODE> - the percentage boundaries at which the receiver shall be split.</DL> </DD> </DL> <HR> <A NAME="splitApproximately(hep.aida.IAxis, int)"><!-- --></A><H3> splitApproximately</H3> <PRE> public <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A>[] <B>splitApproximately</B>(<A HREF="../../../hep/aida/IAxis.html" title="interface in hep.aida">IAxis</A> axis, int k)</PRE> <DL> <DD>Divides (rebins) a copy of the receiver at the given <i>interval boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range. For each interval boundary of the axis (including -infinity and +infinity), computes the percentage (quantile inverse) of elements less than the boundary. Then lets <A HREF="../../../hep/aida/bin/QuantileBin1D.html#splitApproximately(cern.colt.list.DoubleArrayList, int)"><CODE>splitApproximately(DoubleArrayList,int)</CODE></A> do the real work. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>axis</CODE> - an axis defining interval boundaries.</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE> <DL> <DD>Returns a String representation of the receiver. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin">MightyStaticBin1D</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/QuantileBin1D.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../hep/aida/bin/MightyStaticBin1D.html" title="class in hep.aida.bin"><B>PREV CLASS</B></A> <A HREF="../../../hep/aida/bin/StaticBin1D.html" title="class in hep.aida.bin"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="QuantileBin1D.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_cern.colt.PersistentObject">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=-1 >Jump to the <a target=_top href=http://dsd.lbl.gov/~hoschek/colt >Colt Homepage</a> </BODY> </HTML>