|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.statistics.RandomVariable
public class RandomVariable
This class models a random variable in terms of a distribution and an interval dataset. The dataset holds a random sample from the distribution.
| Constructor Summary | |
|---|---|
RandomVariable()
This default constructor creates a new random variable with a normal distribution and with the default name "X". |
|
RandomVariable(Distribution d)
This special constructor creates a new random variable with a specified probability distribution and the default name "X". |
|
RandomVariable(Distribution d,
java.lang.String n)
This general constructor creates a new random variable with a specified probability distribution and name. |
|
| Method Summary | |
|---|---|
Distribution |
getDistribution()
This method gets the probability distribution. |
IntervalData |
getIntervalData()
Get the data distribution. |
java.lang.String |
getName()
This method gets the name of the random variable. |
double |
getValue()
This method gets the current value of the random variable. |
void |
reset()
This method resets the data distribution. |
void |
sample()
This method simulates a value of the probability distribution and assigns the value to the data distribution. |
void |
setDistribution(Distribution d)
This method assigns the probability distribution and create a corresponding interval data distribution. |
void |
setName(java.lang.String n)
This method assign a name to the random variable. |
void |
setValue(double x)
This method assigns a value to the random variable. |
double |
simulate()
This method simulates a value of the probability distribution, assigns the value to the data distribution, and returns the value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomVariable(Distribution d,
java.lang.String n)
d - the probability distributionn - the name of the variablepublic RandomVariable(Distribution d)
d - the probability distributionpublic RandomVariable()
| Method Detail |
|---|
public void setDistribution(Distribution d)
d - the probability distributionpublic Distribution getDistribution()
public IntervalData getIntervalData()
public void setValue(double x)
x - DOCUMENT ME!public double getValue()
public void sample()
public double simulate()
public void reset()
public java.lang.String getName()
getName in interface Namedpublic void setName(java.lang.String n)
n - the name of the random variable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||