RandomVariables
Class GammaVariable

java.lang.Object
  extended byStatistics.RandomVariable
      extended byRandomVariables.GammaVariable

public class GammaVariable
extends RandomVariable

Gamma(alpha,beta) variable.


Constructor Summary
GammaVariable(double alpha, double beta)
          Warning: we use the parameters alpha, beta from the probability density f(x)=x^alpha*exp(-x/beta)/Gamma(alpha)beta^alpha .
GammaVariable(double mean, double variance, int dummy)
          Constructor using mean and variance as arguments.
 
Method Summary
 double analyticMean()
          Unconditional mean given by exact formula.
 double analyticVariance()
          Unconditional variance given by exact formula.
 cern.jet.random.Gamma getGammaDistribution()
          The underlying cern.jet.random.Gamma Gamma distribution.
 double getValue(int t)
          A new sample from the distribution of X conditioned on information available at time t.
static void main(java.lang.String[] args)
          Allocates a Gamma variable using mean and variance as the parameters and compares the analytic mean and variance to Monte Carlo mean and variance over a sample of size 100,000.
 
Methods inherited from class Statistics.RandomVariable
analyticCentralMoment, analyticConditionalCentraMoment, analyticConditionalMean, analyticConditionalMoment, analyticConditionalVariance, analyticMoment, 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, 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

GammaVariable

public GammaVariable(double alpha,
                     double beta)

Warning: we use the parameters alpha, beta from the probability density

f(x)=x^alpha*exp(-x/beta)/Gamma(alpha)beta^alpha
. Note that cern.jet.random.Gamma uses the parameter lambda=1/beta instead.

Parameters:
alpha - first parameter of the gamma distribution.
beta - second parameter of the gamma distribution.

GammaVariable

public GammaVariable(double mean,
                     double variance,
                     int dummy)

Constructor using mean and variance as arguments.

Parameters:
mean - the mean.
variance - the variance.
dummy - dummy variable to destinguish the constructor parameter signatures. Assign any value.
Method Detail

analyticMean

public double analyticMean()
Description copied from class: RandomVariable

Unconditional mean given by exact formula.

Since in general there are no analytic formulas the default is an error message and program abort. Override this in special cases where analytic formulas do exist.

Overrides:
analyticMean in class RandomVariable

analyticVariance

public double analyticVariance()
Description copied from class: RandomVariable

Unconditional variance given by exact formula.

Since in general there are no analytic formulas the default is an error message and program abort. Override this in special cases where analytic formulas do exist.

Overrides:
analyticVariance in class RandomVariable

getGammaDistribution

public cern.jet.random.Gamma getGammaDistribution()
The underlying cern.jet.random.Gamma Gamma distribution. Much additional functionality. See the javdoc of the colt distribution.


getValue

public double getValue(int t)
Description copied from class: RandomVariable

A new sample from the distribution of X conditioned on information available at time t.

This is the crucial method defining the random variable and information structure.

Specified by:
getValue in class RandomVariable
Parameters:
t - time - ingnored no sense of time defined (no conditioning in this context).

main

public static void main(java.lang.String[] args)
Allocates a Gamma variable using mean and variance as the parameters and compares the analytic mean and variance to Monte Carlo mean and variance over a sample of size 100,000. A smoothed histogram is also shown.