|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucla.stat.SOCR.distributions.RandomVariable
public class RandomVariable
Constructor Summary | |
---|---|
RandomVariable(Distribution d)
Special constructor: create a new random variable with a specified probability distribution and the name X |
|
RandomVariable(Distribution d,
java.lang.String n)
General constructor: create a new random variable with a specified probability distribution and name |
Method Summary | |
---|---|
Distribution |
getDistribution()
Get the probability distribution |
IntervalData |
getIntervalData()
Get the data distribution |
java.lang.String |
getName()
Get the name of the random variable |
double |
getValue()
Get the current value of the random variable |
void |
reset()
Reset the data distribution |
void |
sample()
Simulate a value of the probability distribution and assign the value to the data distribution |
void |
setDistribution(Distribution d)
Assign the probability distribution and create a corresponding data distribution |
void |
setName(java.lang.String n)
Assign a name to the random variable |
void |
setValue(double x)
Assign a value to the random variable |
double |
simulate()
Simulate a value of the probability distribution, assign the value to the data distribution and return 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)
public RandomVariable(Distribution d)
Method Detail |
---|
public void setDistribution(Distribution d)
public Distribution getDistribution()
public IntervalData getIntervalData()
public void setValue(double x)
public double getValue()
public void sample()
public double simulate()
public void reset()
public java.lang.String getName()
public void setName(java.lang.String n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |