@PublicationReference(author="Wikipedia", title="Weibull Distribution", type=WebPage, year=2010, url="http://en.wikipedia.org/wiki/Weibull_distribution") public class WeibullDistribution extends AbstractClosedFormSmoothUnivariateDistribution
Modifier and Type | Class and Description |
---|---|
static class |
WeibullDistribution.CDF
CDF of the Weibull distribution
|
static class |
WeibullDistribution.PDF
PDF of the Weibull distribution
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SCALE
Default scale, 1.0
|
static double |
DEFAULT_SHAPE
Default shape, 1.0.
|
protected double |
scale
Scale parameter, must be greater than 0.0
|
protected double |
shape
Shape parameter, must be greater than 0.0
|
Constructor and Description |
---|
WeibullDistribution()
Creates a new instance of WeibullDistribution
|
WeibullDistribution(double shape,
double scale)
Creates a new instance of WeibullDistribution
|
WeibullDistribution(WeibullDistribution other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
WeibullDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector |
convertToVector()
Converts the object to a vector.
|
WeibullDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution.
|
java.lang.Double |
getMaxSupport()
Gets the minimum support (domain or input) of the distribution.
|
double |
getMeanAsDouble()
Gets the mean of the distribution as a double.
|
java.lang.Double |
getMinSupport()
Gets the minimum support (domain or input) of the distribution.
|
WeibullDistribution.PDF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
getScale()
Getter for scale
|
double |
getShape()
Getter for shape
|
double |
getVariance()
Gets the variance of the distribution.
|
double |
sampleAsDouble(java.util.Random random)
Samples a value from this distribution as a double.
|
void |
sampleInto(java.util.Random random,
double[] output,
int start,
int length)
Samples values from this distribution as an array of doubles.
|
void |
setScale(double scale)
Setter for scale
|
void |
setShape(double shape)
Setter for shape
|
getMean, sampleAsDoubles, sampleInto
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sample, sample
public static final double DEFAULT_SHAPE
public static final double DEFAULT_SCALE
protected double shape
protected double scale
public WeibullDistribution()
public WeibullDistribution(double shape, double scale)
shape
- Shape parameter, must be greater than 0.0scale
- Scale parameter, must be greater than 0.0public WeibullDistribution(WeibullDistribution other)
other
- WeibullDistribution to copypublic WeibullDistribution clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface Vectorizable
clone
in interface CloneableSerializable
clone
in class AbstractClosedFormUnivariateDistribution<java.lang.Double>
public double getShape()
public void setShape(double shape)
shape
- Shape parameter, must be greater than 0.0public double getScale()
public void setScale(double scale)
scale
- Scale parameter, must be greater than 0.0public double getMeanAsDouble()
UnivariateDistribution
public double getVariance()
UnivariateDistribution
public double sampleAsDouble(java.util.Random random)
SmoothUnivariateDistribution
sampleAsDouble
in interface SmoothUnivariateDistribution
sampleAsDouble
in class AbstractClosedFormSmoothUnivariateDistribution
random
- Random number generator to use.public void sampleInto(java.util.Random random, double[] output, int start, int length)
SmoothUnivariateDistribution
random
- Random number generator to use.output
- The array to write the result into. Cannot be null.start
- The offset in the array to start writing at. Cannot be negative.length
- The number of values to sample. Cannot be negative.public Vector convertToVector()
Vectorizable
public void convertFromVector(Vector parameters)
Vectorizable
parameters
- The parameters to incorporate.public java.lang.Double getMinSupport()
UnivariateDistribution
public java.lang.Double getMaxSupport()
UnivariateDistribution
public WeibullDistribution.PDF getProbabilityFunction()
ComputableDistribution
public WeibullDistribution.CDF getCDF()
UnivariateDistribution