public class StatisticsTools
extends java.lang.Object
Constructor and Description |
---|
StatisticsTools() |
Modifier and Type | Method and Description |
---|---|
static double[] |
getHistogram(int[] vals)
Histogram
Get the relative histogram of an array, using 0 to 255 value bins (as for greyscale image)
|
static double |
getQuantile(double[] hist,
double p)
Estimate quantiles from a histogram, the x-values assumed to be 0 to length(histogram)-1 (i.e.
|
static double |
getQuantileFromValues(double[] val,
double p)
Estimate quantiles from observed values and a desired probability value.
|
public static double[] getHistogram(int[] vals)
vals
- array of values to be counted (must be within 0 to 255)public static double getQuantileFromValues(double[] val, double p)
val
- Array of observed valuesp
- Cumulative probability associated with the quantilepublic static double getQuantile(double[] hist, double p)
hist
- Histogram of occurrence of values 0<=x<1, then 1<=x<2, ... (n-1)<=x<np
- Cumulative probability associated with the quantile