Package edu.cmu.tetrad.util.dist
Interface Distribution
- All Superinterfaces:
Serializable,TetradSerializable
- All Known Implementing Classes:
Beta,ChiSquare,Discrete,Exponential,Gamma,GaussianPower,Indicator,LogNormal,MixtureOfGaussians,Normal,Poisson,SingleValue,Split,TruncatedNormal,Uniform
Interface for a statistical distribution from which random values can be drawn. Methods are provided for
setting/getting parameters in the interface. A single random number generator is used throughout Tetrad to ensure
randomness.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longConstantserialVersionUID=23L -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the name of the distribution.intReturns the number of parameters in the distribution.doublegetParameter(int index) Returns the index'th parameter.getParameterName(int index) The name of the index'th parameter, for display purposes.doubleReturns the next random number from the distribution.voidsetParameter(int index, double value) Sets the index'th parameter to the given value.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDConstantserialVersionUID=23L- See Also:
-
-
Method Details
-
getNumParameters
int getNumParameters()Returns the number of parameters in the distribution.- Returns:
- the number of parameters.
-
getName
String getName()Returns the name of the distribution.- Returns:
- the name.
-
setParameter
void setParameter(int index, double value) Sets the index'th parameter to the given value.- Parameters:
index- Ibid. Must be >= 0 and < # parameters.value- Ibid.
-
getParameter
double getParameter(int index) Returns the index'th parameter.- Parameters:
index- Ibid. Muist be <= 0 and < # parameters.- Returns:
- The Ibid.
-
getParameterName
The name of the index'th parameter, for display purposes.- Parameters:
index- Ibid. Must be >= 0 and < # parameters.- Returns:
- Ibid.
-
nextRandom
double nextRandom()Returns the next random number from the distribution.- Returns:
- Ibid.
-