Class EmpiricalRandomVariable

  extended byStatistics.RandomVariable
      extended byStatistics.EmpiricalRandomVariable

public class EmpiricalRandomVariable
extends RandomVariable

A random variable X distributed according to the empirical distribution associated with a data sample. This distribution is the convex combination of point masses concentrated at the data points with all weights being equal.

In other words the distribution assumes that the data points exhaust all possible values and all values are equally likely. Drawing samples of X amounts to sampling from the data set with replacement.

Class maintains a reference to the data set array but does not construct a copy of this array. Displays a progress bar reporting the progress on filling the bins (updated every 500 samples).

No information to condition on is available in general and so the time parameter t is disregarded.

Constructor Summary
EmpiricalRandomVariable(double[] data_set)
          Calls the default super constructor (no parameters).
Method Summary
 double[] get_data_set()
          The array containing the sample data.
 int get_sampleSize()
          Size of the data set.
 double getValue(int t)
          Sampling from the distribution of X, no conditioning.
Methods inherited from class Statistics.RandomVariable
analyticCentralMoment, analyticConditionalCentraMoment, analyticConditionalMean, analyticConditionalMoment, analyticConditionalVariance, analyticMean, analyticMoment, analyticVariance, basicHistogram, centered_X, conditionalEmpiricalDistribution, conditionalExpectation, conditionalExpectation, conditionalExpectation, conditionalExpectation, conditionalExpectation, conditionalHistogram, conditionalHistogram, conditionalMeanAndStandardDeviation, conditionalMeanAndStandardDeviation, conditionalMeanAndStandardDeviation, conditionalMeanAndStandardDeviation, conditionalMoment, conditionalVariance, cumulativeDistributionFunction, displayConditionalHistogram, displayConditionalHistogram, displayConditionalHistogram, displayConditionalHistogram, displayHistogram, displayHistogram, displayHistogram, displayHistogram, div, empiricalDistribution, expectation, expectation, expectation, expectation, expectation, fillSampleSet, get_empiricalDistributionIsInitialized, get_hasAnalyticCentralMoment, get_hasAnalyticMean, get_hasAnalyticMoment, get_hasAnalyticVariance, get_hasConditionalAnalyticCentralMoment, get_hasConditionalAnalyticMean, get_hasConditionalAnalyticMoment, get_hasConditionalAnalyticVariance, histogram, histogram, initEmpiricalDistribution, main, meanAndStandardDeviation, meanAndStandardDeviation, meanAndStandardDeviation, meanAndStandardDeviation, minus, mult, plus, quantile, scale, setHasAnalyticMean, setHasAnalyticVariance, variance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public EmpiricalRandomVariable(double[] data_set)
Calls the default super constructor (no parameters).

data_set - array containing the data sample.
Method Detail


public int get_sampleSize()
Size of the data set.


public double[] get_data_set()
The array containing the sample data.


public double getValue(int t)

Sampling from the distribution of X, no conditioning. Time parameter t (information) ignored. Samples from the underlying data set with replacement.

Specified by:
getValue in class RandomVariable
t - current time (irrelevant).