|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.math.Statistics
Hold some statistics about a series of sample values. Given a series of sample values
s0, s1, s2,
s3..., this class computes minimum,
maximum, mean, root mean square
and standard deviation. Statistics are computed on the fly;
the sample values are never stored in memory.
An instance of is initially empty (i.e. all statistical values are set
to NaN
). The statistics are updated every time an add(double)
method is invoked with a non-NaN value. A typical usage of this
class is:
double[] data = new double[1000]; // (Compute some data values here...) Statistics stats = new Statistics(); for (int i=0; i<data.length; i++) { stats.add(data[i]); } System.out.println(stats);
Nested Class Summary | |
static class |
Statistics.Delta
Hold some statistics about a series of sample values and the difference between them. |
Constructor Summary | |
Statistics()
Construct an initially empty set of statistics. |
Method Summary | |
void |
add(double sample)
Update statistics for the specified sample. |
void |
add(long sample)
Update statistics for the specified sample. |
void |
add(Statistics stats)
Update statistics with all samples from the specified . |
java.lang.Object |
clone()
Returns a clone of this statistics. |
int |
count()
Returns the number of samples, excluding NaN values. |
int |
countNaN()
Returns the number of NaN samples. |
boolean |
equals(java.lang.Object obj)
Test this statistics with the specified object for equality. |
int |
hashCode()
Returns a hash code value for this statistics. |
double |
maximum()
Returns the maximum sample value, or NaN if none. |
double |
mean()
Returns the mean value, or NaN if none. |
double |
minimum()
Returns the minimum sample value, or NaN if none. |
double |
range()
Returns the range of sample values. |
void |
reset()
Reset the statistics to their initial NaN values.
|
double |
rms()
Returns the root mean square, or NaN if none. |
double |
standardDeviation(boolean allPopulation)
Retourne l'?cart type des ?chantillons par rapport ? la moyenne. |
java.lang.String |
toString()
Returns a string representation of this statistics. |
java.lang.String |
toString(java.util.Locale locale,
boolean tabulations)
Returns a localized string representation of this statistics. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Statistics()
Double.NaN
.
Method Detail |
public void reset()
NaN
values.
This method reset this object state as if it was just created.
public void add(double sample)
sample
- The sample value. NaN
values are ignored.add(long)
,
add(Statistics)
public void add(long sample)
sample
- The sample value.add(double)
,
add(Statistics)
public void add(Statistics stats)
add
for all samples that were added to .
stats
- The statistics to be added to , or if none.public int countNaN()
NaN
samples. samples are
ignored in all other statitical computation. This method count them for information
purpose only.
public int count()
NaN
values.
public double minimum()
NaN
if none.
maximum()
public double maximum()
NaN
if none.
minimum()
public double range()
maximum
-
minimum
, except for rounding error. If no samples were added,
then returns NaN
.
minimum()
,
maximum()
public double mean()
NaN
if none.
public double rms()
NaN
if none.
public double standardDeviation(boolean allPopulation)
0.5 | 69.1% |
1.0 | 84.2% |
1.5 | 93.3% |
2.0 | 97.7% |
3.0 | 99.9% |
allPopulation
- La valeur indique que les donn?es fournies
aux diff?rentes m?thodes repr?sentent l'ensemble de
la polulation. La valeur indique que ces donn?es ne
repr?sentent qu'un ?chantillon de la population, ce qui est g?n?ralement le
cas. Si le nombre de donn?es est ?lev?, alors les valeurs
et donneront sensiblement les m?mes r?sultats.public java.lang.Object clone()
clone
in interface org.opengis.util.Cloneable
public boolean equals(java.lang.Object obj)
public int hashCode()
public final java.lang.String toString()
toString(Locale, boolean)
using the default locale and spaces
separator.
public java.lang.String toString(java.util.Locale locale, boolean tabulations)
If is true, then labels (e.g. "Minimum") and values (e.g. "6.853") are separated by tabulations. Otherwise, they are separated by spaces.Compte: 8726 Minimum: 6.853 Maximum: 8.259 Moyenne: 7.421 RMS: 7.846 ?cart-type: 6.489
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |