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 long
ConstantserialVersionUID=23L
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of the distribution.int
Returns the number of parameters in the distribution.double
getParameter
(int index) Returns the index'th parameter.getParameterName
(int index) The name of the index'th parameter, for display purposes.double
Returns the next random number from the distribution.void
setParameter
(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
-
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.
-