public class DistributionFactory
extends java.lang.Object
The (static) methods of this class invoke the constructor specified in the string. For example,
The string that specifies the distribution (i.e., the formal parameter
str of the methods) must be a valid call of the constructor
of a class that extends ContinuousDistribution or
DiscreteDistribution, and all parameter values must be numerical
values (variable names are not allowed).
The distribution parameters can also be estimated from a set of observations instead of being passed to the constructor. In that case, one passes the vector of observations, and the constructor estimates the parameters by the maximum likelihood method.
| Modifier and Type | Method and Description |
|---|---|
static ContinuousDistribution |
getContinuousDistribution(java.lang.String str)
Uses the Java Reflection API to construct a
ContinuousDistribution
object by executing the code contained in the string str. |
static DiscreteDistribution |
getDiscreteDistribution(java.lang.String str)
Same as
getContinuousDistribution, but for discrete distributions
over the real numbers. |
static DiscreteDistributionInt |
getDiscreteDistributionInt(java.lang.String str)
Same as
getContinuousDistribution, but for discrete distributions
over the integers. |
static Distribution |
getDistribution(java.lang.String str) |
static <T extends ContinuousDistribution> |
getDistributionMLE(java.lang.Class<T> distClass,
double[] x,
int n) |
static <T extends DiscreteDistributionInt> |
getDistributionMLE(java.lang.Class<T> distClass,
int[] x,
int n) |
static ContinuousDistribution |
getDistributionMLE(java.lang.String distName,
double[] x,
int n) |
static DiscreteDistributionInt |
getDistributionMLE(java.lang.String distName,
int[] x,
int n) |
public static Distribution getDistribution(java.lang.String str)
public static ContinuousDistribution getDistributionMLE(java.lang.String distName, double[] x, int n)
public static DiscreteDistributionInt getDistributionMLE(java.lang.String distName, int[] x, int n)
public static <T extends ContinuousDistribution> T getDistributionMLE(java.lang.Class<T> distClass, double[] x, int n)
public static <T extends DiscreteDistributionInt> T getDistributionMLE(java.lang.Class<T> distClass, int[] x, int n)
public static ContinuousDistribution getContinuousDistribution(java.lang.String str)
ContinuousDistribution
object by executing the code contained in the string str.
This code should be a valid invocation of the constructor of a
ContinuousDistribution object.
This method throws exceptions if it cannot parse the given string and
returns null if the distribution object could not be created due to
a Java-specific instantiation problem.str - string that contains a call to the constructor of a continuous
distributionjava.lang.IllegalArgumentException - if parsing problems occured
when reading strjava.lang.ClassCastException - if the distribution string does not represent
a continuous distributionpublic static DiscreteDistribution getDiscreteDistribution(java.lang.String str)
getContinuousDistribution, but for discrete distributions
over the real numbers.str - string that contains a call to the constructor of a discrete
distributionjava.lang.IllegalArgumentException - if parsing problems occured when
reading strjava.lang.ClassCastException - if the distribution string does not represent
a discrete distributionpublic static DiscreteDistributionInt getDiscreteDistributionInt(java.lang.String str)
getContinuousDistribution, but for discrete distributions
over the integers.str - string that contains a call to the constructor of a discrete
distributionjava.lang.IllegalArgumentException - if parsing problems occured when
reading strjava.lang.ClassCastException - if the distribution string does not represent
a discrete distributionTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.