|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.statistics.Distribution
de.unidu.is.statistics.DiscreteDistribution
An class modelling discrete (empirical) probabilistic distributions.
The original values from which the distribution is derived are sorted into bins of equal size. The first bin starts at the minimum value, the last one at the maximum value. This allows for using this distribution for plotting.
If the distribution should be used for computing actual values, the original values are used.
| Field Summary | |
protected double |
max
Maximum original value. |
protected double |
max2
Maximum original value s.th. the integral from 0 to this value if less than 0.999. |
protected double |
min
Minimum original value. |
protected static int |
parts
Number of bins minus 1. |
protected double[] |
values
Original values from which the distribution is derived. |
protected double[] |
x
The x values (bin starting points) of the distribution when plotted. |
protected double[] |
y
The y values (bin frequencies) of the distribution when plotted. |
| Constructor Summary | |
DiscreteDistribution(double[] values)
Constructs a new distribution, based on the specified original values. |
|
| Method Summary | |
void |
computeValues(int num,
double[] ret)
Computes actual values based on the underlying distribution when having the specified number of items, and writes them in decreasing order into the specified array (as many values as possible). |
void |
eliminateZero()
Eliminates info about the distribution at zero. |
double |
getMax()
Returns the maximum original value. |
double |
getMin()
Returns the minimum original value. |
double[] |
getX()
Returns an array with the x values (bin starting points) of the distribution when plotted. |
double[] |
getY()
Returns an array with the y values (bin frequencies) of the distribution when plotted. |
| Methods inherited from class de.unidu.is.statistics.Distribution |
computeValues |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double[] x
protected double[] y
protected static final int parts
protected double[] values
protected double min
protected double max
protected double max2
| Constructor Detail |
public DiscreteDistribution(double[] values)
This constructor also creates the bins. The first bin starts at min, the last one at max.
values - original values from which the distribution is derived| Method Detail |
public double[] getX()
public double[] getY()
public double getMin()
public double getMax()
public void eliminateZero()
eliminateZero in class Distribution
public void computeValues(int num,
double[] ret)
This method uses the original values and repeates them
num/values.lentgh times. Thus, num >=
values.lentgh must hold!
computeValues in class Distributionnum - number of items in totalret - array for the actual values
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||