@PublicationReference(author="Christopher M. Bishop",title="Pattern Recognition and Machine Learning",type=Book,year=2006,pages=101) @PublicationReference(author="Wikipedia",title="Normal-scaled inverse gamma distribution",type=WebPage,year=2010,url="http://en.wikipedia.org/wiki/Normal-scaled_inverse_gamma_distribution") public class NormalInverseGammaDistribution extends AbstractDistribution<Vector> implements ClosedFormComputableDistribution<Vector>
Modifier and Type | Class and Description |
---|---|
static class |
NormalInverseGammaDistribution.PDF
PDF of the NormalInverseGammaDistribution
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_LOCATION
Default location, 0.0.
|
static double |
DEFAULT_PRECISION
Default precision, 1.0.
|
static double |
DEFAULT_SCALE
Default scale, 1.0.
|
static double |
DEFAULT_SHAPE
Default shape, 3.0.
|
Constructor and Description |
---|
NormalInverseGammaDistribution()
Creates a new instance of NormalInverseGammaDistribution
|
NormalInverseGammaDistribution(double location,
double precision,
double shape,
double scale)
Creates a new instance of NormalInverseGammaDistribution
|
NormalInverseGammaDistribution(NormalInverseGammaDistribution other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
NormalInverseGammaDistribution |
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.
|
double |
getLocation()
Getter for location.
|
Vector |
getMean()
Gets the arithmetic mean, or "first central moment" or "expectation",
of the distribution.
|
double |
getPrecision()
Getter for precision
|
NormalInverseGammaDistribution.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
|
void |
sampleInto(java.util.Random random,
int sampleCount,
java.util.Collection<? super Vector> output)
Draws multiple random samples from the distribution and puts the result
into the given collection.
|
void |
setLocation(double location)
Setter for location.
|
void |
setPrecision(double precision)
Setter for precision.
|
void |
setScale(double scale)
Setter for scale
|
void |
setShape(double shape)
Setter for shape
|
java.lang.String |
toString() |
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
sample, sample
public static final double DEFAULT_LOCATION
public static final double DEFAULT_PRECISION
public static final double DEFAULT_SHAPE
public static final double DEFAULT_SCALE
public NormalInverseGammaDistribution()
public NormalInverseGammaDistribution(double location, double precision, double shape, double scale)
location
- Location of the Gaussian kernel.precision
- Precision of the Gaussian kernel, must be greater than zero.shape
- Shape parameter of the Inverse Gamma kernel, must be greater than zero.scale
- Scale parameter of the Inverse Gamma kernel, must be greater than zero.public NormalInverseGammaDistribution(NormalInverseGammaDistribution other)
other
- NormalInverseGammaDistribution to copypublic NormalInverseGammaDistribution 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 AbstractCloneableSerializable
public Vector getMean()
DistributionWithMean
getMean
in interface DistributionWithMean<Vector>
public void sampleInto(java.util.Random random, int sampleCount, java.util.Collection<? super Vector> output)
Distribution
sampleInto
in interface Distribution<Vector>
random
- Random number generator to use.sampleCount
- The number of samples to draw. Cannot be negative.output
- The collection to add the samples into.public Vector convertToVector()
Vectorizable
convertToVector
in interface Vectorizable
public void convertFromVector(Vector parameters)
Vectorizable
convertFromVector
in interface Vectorizable
parameters
- The parameters to incorporate.public NormalInverseGammaDistribution.PDF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<Vector>
public double getLocation()
public void setLocation(double location)
location
- Location of the Gaussian kernel.public double getPrecision()
public void setPrecision(double precision)
precision
- Precision of the Gaussian kernel, must be greater than zero.public double getShape()
public void setShape(double shape)
shape
- Shape parameter of the Inverse Gamma kernel, must be greater than zero.public double getScale()
public void setScale(double scale)
scale
- Scale parameter of the Inverse Gamma kernel, must be greater than zero.public java.lang.String toString()
toString
in class java.lang.Object