blob: 74c530f7c9ceca25bc1e7b53c7a7e1d529531fcd [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Percentile (Apache Commons Math 3.3 API)</title>
<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="Percentile (Apache Commons Math 3.3 API)";
}
//-->
</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/Percentile.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-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Min.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/stat/descriptive/rank/Percentile.html" target="_top">Frames</a></li>
<li><a href="Percentile.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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</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">org.apache.commons.math3.stat.descriptive.rank</div>
<h2 title="Class Percentile" class="title">Class Percentile</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/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><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.stat.descriptive.rank.Percentile</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html" title="interface in org.apache.commons.math3.stat.descriptive">UnivariateStatistic</a>, <a href="../../../../../../../org/apache/commons/math3/util/MathArrays.Function.html" title="interface in org.apache.commons.math3.util">MathArrays.Function</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Median.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Median</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Percentile</span>
extends <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a>
implements <a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">Provides percentile computation.
<p>
There are several commonly used methods for estimating percentiles (a.k.a.
quantiles) based on sample data. For large samples, the different methods
agree closely, but when sample sizes are small, different methods will give
significantly different results. The algorithm implemented here works as follows:
<ol>
<li>Let <code>n</code> be the length of the (sorted) array and
<code>0 < p <= 100</code> be the desired percentile.</li>
<li>If <code> n = 1 </code> return the unique array element (regardless of
the value of <code>p</code>); otherwise </li>
<li>Compute the estimated percentile position
<code> pos = p * (n + 1) / 100</code> and the difference, <code>d</code>
between <code>pos</code> and <code>floor(pos)</code> (i.e. the fractional
part of <code>pos</code>).</li>
<li> If <code>pos < 1</code> return the smallest element in the array.</li>
<li> Else if <code>pos >= n</code> return the largest element in the array.</li>
<li> Else let <code>lower</code> be the element in position
<code>floor(pos)</code> in the array and let <code>upper</code> be the
next element in the array. Return <code>lower + d * (upper - lower)</code>
</li>
</ol></p>
<p>
To compute percentiles, the data must be at least partially ordered. Input
arrays are copied and recursively partitioned using an ordering definition.
The ordering used by <code>Arrays.sort(double[])</code> is the one determined
by <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true#compareTo(java.lang.Double)" title="class or interface in java.lang"><code>Double.compareTo(Double)</code></a>. This ordering makes
<code>Double.NaN</code> larger than any other value (including
<code>Double.POSITIVE_INFINITY</code>). Therefore, for example, the median
(50th percentile) of
<code>{0, 1, 2, 3, 4, Double.NaN}</code> evaluates to <code>2.5.</code></p>
<p>
Since percentile estimation usually involves interpolation between array
elements, arrays containing <code>NaN</code> or infinite values will often
result in <code>NaN</code> or infinite values returned.</p>
<p>
Since 2.2, Percentile uses only selection instead of complete sorting
and caches selection algorithm state between calls to the various
<code>evaluate</code> methods. This greatly improves efficiency, both for a single
percentile and multiple percentile computations. To maximize performance when
multiple percentiles are computed based on the same data, users should set the
data array once using either one of the <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double[], double)"><code>evaluate(double[], double)</code></a> or
<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#setData(double[])"><code>setData(double[])</code></a> methods and thereafter <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double)"><code>evaluate(double)</code></a>
with just the percentile provided.
</p>
<p>
<strong>Note that this implementation is not synchronized.</strong> If
multiple threads access an instance of this class concurrently, and at least
one of the threads invokes the <code>increment()</code> or
<code>clear()</code> method, it must be synchronized externally.</p></div>
<dl><dt><span class="strong">Version:</span></dt>
<dd>$Id: Percentile.java 1416643 2012-12-03 19:37:14Z tn $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../serialized-form.html#org.apache.commons.math3.stat.descriptive.rank.Percentile">Serialized Form</a></dd></dl>
</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">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#Percentile()">Percentile</a></strong>()</code>
<div class="block">Constructs a Percentile with a default quantile
value of 50.0.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#Percentile(double)">Percentile</a></strong>(double&nbsp;p)</code>
<div class="block">Constructs a Percentile with the specific quantile value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#Percentile(org.apache.commons.math3.stat.descriptive.rank.Percentile)">Percentile</a></strong>(<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;original)</code>
<div class="block">Copy constructor, creates a new <code>Percentile</code> identical
to the <code>original</code></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">&nbsp;</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><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#copy()">copy</a></strong>()</code>
<div class="block">Returns a copy of the statistic with the same internal state.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#copy(org.apache.commons.math3.stat.descriptive.rank.Percentile, org.apache.commons.math3.stat.descriptive.rank.Percentile)">copy</a></strong>(<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;source,
<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;dest)</code>
<div class="block">Copies source to dest.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double)">evaluate</a></strong>(double&nbsp;p)</code>
<div class="block">Returns the result of evaluating the statistic over the stored data.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double[], double)">evaluate</a></strong>(double[]&nbsp;values,
double&nbsp;p)</code>
<div class="block">Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double[], int, int)">evaluate</a></strong>(double[]&nbsp;values,
int&nbsp;start,
int&nbsp;length)</code>
<div class="block">Returns an estimate of the <code>quantile</code>th percentile of the
designated values in the <code>values</code> array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#evaluate(double[], int, int, double)">evaluate</a></strong>(double[]&nbsp;values,
int&nbsp;begin,
int&nbsp;length,
double&nbsp;p)</code>
<div class="block">Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array, starting with the element in (0-based)
position <code>begin</code> in the array and including <code>length</code>
values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#getQuantile()">getQuantile</a></strong>()</code>
<div class="block">Returns the value of the quantile field (determines what percentile is
computed when evaluate() is called with no quantile argument).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#setData(double[])">setData</a></strong>(double[]&nbsp;values)</code>
<div class="block">Set the data array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#setData(double[], int, int)">setData</a></strong>(double[]&nbsp;values,
int&nbsp;begin,
int&nbsp;length)</code>
<div class="block">Set the data array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#setQuantile(double)">setQuantile</a></strong>(double&nbsp;p)</code>
<div class="block">Sets the value of the quantile field (determines what percentile is
computed when evaluate() is called with no quantile argument).</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.math3.stat.descriptive.AbstractUnivariateStatistic">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.math3.stat.descriptive.<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a></h3>
<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#evaluate()">evaluate</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#evaluate(double[])">evaluate</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#getData()">getData</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#getDataRef()">getDataRef</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#test(double[], double[], int, int)">test</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#test(double[], double[], int, int, boolean)">test</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#test(double[], int, int)">test</a>, <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#test(double[], int, int, boolean)">test</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/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/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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="Percentile()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Percentile</h4>
<pre>public&nbsp;Percentile()</pre>
<div class="block">Constructs a Percentile with a default quantile
value of 50.0.</div>
</li>
</ul>
<a name="Percentile(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Percentile</h4>
<pre>public&nbsp;Percentile(double&nbsp;p)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Constructs a Percentile with the specific quantile value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the quantile</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if p is not greater than 0 and less
than or equal to 100</dd></dl>
</li>
</ul>
<a name="Percentile(org.apache.commons.math3.stat.descriptive.rank.Percentile)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Percentile</h4>
<pre>public&nbsp;Percentile(<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;original)
throws <a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></pre>
<div class="block">Copy constructor, creates a new <code>Percentile</code> identical
to the <code>original</code></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>original</code> - the <code>Percentile</code> instance to copy</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if original is null</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="setData(double[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setData</h4>
<pre>public&nbsp;void&nbsp;setData(double[]&nbsp;values)</pre>
<div class="block">Set the data array.
<p>
The stored value is a copy of the parameter array, not the array itself.
</p></div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#setData(double[])">setData</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - data array to store (may be null to remove stored data)</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#evaluate()"><code>AbstractUnivariateStatistic.evaluate()</code></a></dd></dl>
</li>
</ul>
<a name="setData(double[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setData</h4>
<pre>public&nbsp;void&nbsp;setData(double[]&nbsp;values,
int&nbsp;begin,
int&nbsp;length)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Set the data array. The input array is copied, not referenced.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#setData(double[], int, int)">setData</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - data array to store</dd><dd><code>begin</code> - the index of the first element to include</dd><dd><code>length</code> - the number of elements to include</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if values is null or the indices
are not valid</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#evaluate()"><code>AbstractUnivariateStatistic.evaluate()</code></a></dd></dl>
</li>
</ul>
<a name="evaluate(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluate</h4>
<pre>public&nbsp;double&nbsp;evaluate(double&nbsp;p)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Returns the result of evaluating the statistic over the stored data.
<p>
The stored array is the one which was set by previous calls to
<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html#setData(double[])"><code>setData(double[])</code></a>
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the percentile value to compute</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value of the statistic applied to the stored data</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if p is not a valid quantile value
(p must be greater than 0 and less than or equal to 100)</dd></dl>
</li>
</ul>
<a name="evaluate(double[], double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluate</h4>
<pre>public&nbsp;double&nbsp;evaluate(double[]&nbsp;values,
double&nbsp;p)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array.
<p>
Calls to this method do not modify the internal <code>quantile</code>
state of this statistic.</p>
<p>
<ul>
<li>Returns <code>Double.NaN</code> if <code>values</code> has length
<code>0</code></li>
<li>Returns (for any value of <code>p</code>) <code>values[0]</code>
if <code>values</code> has length <code>1</code></li>
<li>Throws <code>MathIllegalArgumentException</code> if <code>values</code>
is null or p is not a valid quantile value (p must be greater than 0
and less than or equal to 100) </li>
</ul></p>
<p>
See <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a> for a description of the percentile estimation
algorithm used.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - input array of values</dd><dd><code>p</code> - the percentile value to compute</dd>
<dt><span class="strong">Returns:</span></dt><dd>the percentile value or Double.NaN if the array is empty</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if <code>values</code> is null
or p is invalid</dd></dl>
</li>
</ul>
<a name="evaluate(double[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluate</h4>
<pre>public&nbsp;double&nbsp;evaluate(double[]&nbsp;values,
int&nbsp;start,
int&nbsp;length)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Returns an estimate of the <code>quantile</code>th percentile of the
designated values in the <code>values</code> array. The quantile
estimated is determined by the <code>quantile</code> property.
<p>
<ul>
<li>Returns <code>Double.NaN</code> if <code>length = 0</code></li>
<li>Returns (for any value of <code>quantile</code>)
<code>values[begin]</code> if <code>length = 1 </code></li>
<li>Throws <code>MathIllegalArgumentException</code> if <code>values</code>
is null, or <code>start</code> or <code>length</code> is invalid</li>
</ul></p>
<p>
See <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a> for a description of the percentile estimation
algorithm used.</p></div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html#evaluate(double[], int, int)">evaluate</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html" title="interface in org.apache.commons.math3.stat.descriptive">UnivariateStatistic</a></code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/util/MathArrays.Function.html#evaluate(double[], int, int)">evaluate</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/util/MathArrays.Function.html" title="interface in org.apache.commons.math3.util">MathArrays.Function</a></code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#evaluate(double[], int, int)">evaluate</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - the input array</dd><dd><code>start</code> - index of the first array element to include</dd><dd><code>length</code> - the number of elements to include</dd>
<dt><span class="strong">Returns:</span></dt><dd>the percentile value</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if the parameters are not valid</dd></dl>
</li>
</ul>
<a name="evaluate(double[], int, int, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluate</h4>
<pre>public&nbsp;double&nbsp;evaluate(double[]&nbsp;values,
int&nbsp;begin,
int&nbsp;length,
double&nbsp;p)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Returns an estimate of the <code>p</code>th percentile of the values
in the <code>values</code> array, starting with the element in (0-based)
position <code>begin</code> in the array and including <code>length</code>
values.
<p>
Calls to this method do not modify the internal <code>quantile</code>
state of this statistic.</p>
<p>
<ul>
<li>Returns <code>Double.NaN</code> if <code>length = 0</code></li>
<li>Returns (for any value of <code>p</code>) <code>values[begin]</code>
if <code>length = 1 </code></li>
<li>Throws <code>MathIllegalArgumentException</code> if <code>values</code>
is null , <code>begin</code> or <code>length</code> is invalid, or
<code>p</code> is not a valid quantile value (p must be greater than 0
and less than or equal to 100)</li>
</ul></p>
<p>
See <a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><code>Percentile</code></a> for a description of the percentile estimation
algorithm used.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - array of input values</dd><dd><code>p</code> - the percentile to compute</dd><dd><code>begin</code> - the first (0-based) element to include in the computation</dd><dd><code>length</code> - the number of array elements to include</dd>
<dt><span class="strong">Returns:</span></dt><dd>the percentile value</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if the parameters are not valid or the
input array is null</dd></dl>
</li>
</ul>
<a name="getQuantile()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuantile</h4>
<pre>public&nbsp;double&nbsp;getQuantile()</pre>
<div class="block">Returns the value of the quantile field (determines what percentile is
computed when evaluate() is called with no quantile argument).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>quantile</dd></dl>
</li>
</ul>
<a name="setQuantile(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setQuantile</h4>
<pre>public&nbsp;void&nbsp;setQuantile(double&nbsp;p)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Sets the value of the quantile field (determines what percentile is
computed when evaluate() is called with no quantile argument).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - a value between 0 < p <= 100</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if p is not greater than 0 and less
than or equal to 100</dd></dl>
</li>
</ul>
<a name="copy()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;copy()</pre>
<div class="block">Returns a copy of the statistic with the same internal state.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html#copy()">copy</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/UnivariateStatistic.html" title="interface in org.apache.commons.math3.stat.descriptive">UnivariateStatistic</a></code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html#copy()">copy</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/AbstractUnivariateStatistic.html" title="class in org.apache.commons.math3.stat.descriptive">AbstractUnivariateStatistic</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>a copy of the statistic</dd></dl>
</li>
</ul>
<a name="copy(org.apache.commons.math3.stat.descriptive.rank.Percentile, org.apache.commons.math3.stat.descriptive.rank.Percentile)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;void&nbsp;copy(<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;source,
<a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Percentile.html" title="class in org.apache.commons.math3.stat.descriptive.rank">Percentile</a>&nbsp;dest)
throws <a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></pre>
<div class="block">Copies source to dest.
<p>Neither source nor dest can be null.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>source</code> - Percentile to copy</dd><dd><code>dest</code> - Percentile to copy to</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if either source or dest is null</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/Percentile.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-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/stat/descriptive/rank/Min.html" title="class in org.apache.commons.math3.stat.descriptive.rank"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/stat/descriptive/rank/Percentile.html" target="_top">Frames</a></li>
<li><a href="Percentile.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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</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>Copyright &#169; 2003&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>