public final class StdStats extends Object
For additional documentation, see Section 2.2 of Introduction to Programming in Java: An Interdisciplinary Approach by Robert Sedgewick and Kevin Wayne.
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Test client.
|
static double |
max(double[] a)
Returns the maximum value in the array a[], -infinity if no such value.
|
static double |
max(double[] a,
int lo,
int hi)
Returns the maximum value in the subarray a[lo..hi], -infinity if no such value.
|
static int |
max(int[] a)
Returns the maximum value in the array a[], Integer.MIN_VALUE if no such value.
|
static double |
mean(double[] a)
Returns the average value in the array a[], NaN if no such value.
|
static double |
mean(double[] a,
int lo,
int hi)
Returns the average value in the subarray a[lo..hi], NaN if no such value.
|
static double |
mean(int[] a)
Returns the average value in the array a[], NaN if no such value.
|
static double |
min(double[] a)
Returns the minimum value in the array a[], +infinity if no such value.
|
static double |
min(double[] a,
int lo,
int hi)
Returns the minimum value in the subarray a[lo..hi], +infinity if no such value.
|
static int |
min(int[] a)
Returns the minimum value in the array a[], Integer.MAX_VALUE if no such value.
|
static void |
plotBars(double[] a)
Plots bars from (0, a[i]) to (i, a[i]) to standard draw.
|
static void |
plotLines(double[] a)
Plots line segments connecting points (i, a[i]) to standard draw.
|
static void |
plotPoints(double[] a)
Plots the points (i, a[i]) to standard draw.
|
static double |
stddev(double[] a)
Returns the sample standard deviation in the array a[], NaN if no such value.
|
static double |
stddev(double[] a,
int lo,
int hi)
Returns the sample standard deviation in the subarray a[lo..hi], NaN if no such value.
|
static double |
stddev(int[] a)
Returns the sample standard deviation in the array a[], NaN if no such value.
|
static double |
stddevp(double[] a)
Returns the population standard deviation in the array a[], NaN if no such value.
|
static double |
stddevp(double[] a,
int lo,
int hi)
Returns the population standard deviation in the subarray a[lo..hi], NaN if no such value.
|
static double |
sum(double[] a)
Returns the sum of all values in the array a[].
|
static double |
sum(double[] a,
int lo,
int hi)
Returns the sum of all values in the subarray a[lo..hi].
|
static int |
sum(int[] a)
Returns the sum of all values in the array a[].
|
static double |
var(double[] a)
Returns the sample variance in the array a[], NaN if no such value.
|
static double |
var(double[] a,
int lo,
int hi)
Returns the sample variance in the subarray a[lo..hi], NaN if no such value.
|
static double |
var(int[] a)
Returns the sample variance in the array a[], NaN if no such value.
|
static double |
varp(double[] a)
Returns the population variance in the array a[], NaN if no such value.
|
static double |
varp(double[] a,
int lo,
int hi)
Returns the population variance in the subarray a[lo..hi], NaN if no such value.
|
public static double max(double[] a)
public static double max(double[] a,
int lo,
int hi)
public static int max(int[] a)
public static double min(double[] a)
public static double min(double[] a,
int lo,
int hi)
public static int min(int[] a)
public static double mean(double[] a)
public static double mean(double[] a,
int lo,
int hi)
public static double mean(int[] a)
public static double var(double[] a)
public static double var(double[] a,
int lo,
int hi)
public static double var(int[] a)
public static double varp(double[] a)
public static double varp(double[] a,
int lo,
int hi)
public static double stddev(double[] a)
public static double stddev(double[] a,
int lo,
int hi)
public static double stddev(int[] a)
public static double stddevp(double[] a)
public static double stddevp(double[] a,
int lo,
int hi)
public static double sum(double[] a)
public static double sum(double[] a,
int lo,
int hi)
public static int sum(int[] a)
public static void plotPoints(double[] a)
public static void plotLines(double[] a)
public static void plotBars(double[] a)
public static void main(String[] args)
Copyright © 2014. All Rights Reserved.