Normal |
The NormalGamma distribution is the conjugate prior distribution for the Normal distribution. It specifies a prior over the mean and precision of the Normal distribution.
It is parameterized by four numbers: the mean location, the mean scale, the precision shape and the precision inverse scale.
The distribution NG(mu, tau | mloc,mscale,psscale,pinvscale) = Normal(mu | mloc, 1/(mscale*tau)) * Gamma(tau | psscale,pinvscale).
The following degenerate cases are special: when the precision is known, the precision shape will encode the value of the precision while the precision inverse scale is positive infinity. When the mean is known, the mean location will encode the value of the mean while the scale will be positive infinity. A completely degenerate NormalGamma distribution with known mean and precision is possible as well.
Wikipedia - Normal-Gamma distribution.public class NormalGamma : IDistribution
The NormalGamma type exposes the following members.
Name | Description | |
---|---|---|
NormalGamma(Double, Double, Double, Double) | Initializes a new instance of the NormalGamma class. | |
NormalGamma(Double, Double, Double, Double, Random) | Initializes a new instance of the NormalGamma class. |
Name | Description | |
---|---|---|
Mean | Gets the mean of the distribution. | |
MeanLocation | Gets the location of the mean. | |
MeanScale | Gets the scale of the mean. | |
PrecisionInverseScale | Gets the inverse scale of the precision. | |
PrecisionShape | Gets the shape of the precision. | |
RandomSource | Gets or sets the random number generator which is used to draw random samples. | |
Variance | Gets the variance of the distribution. |
Name | Description | |
---|---|---|
Density(MeanPrecisionPair) | Evaluates the probability density function for a NormalGamma distribution. | |
Density(Double, Double) | Evaluates the probability density function for a NormalGamma distribution. | |
DensityLn(MeanPrecisionPair) | Evaluates the log probability density function for a NormalGamma distribution. | |
DensityLn(Double, Double) | Evaluates the log probability density function for a NormalGamma distribution. | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
GetHashCode | Serves as the default hash function. (Inherited from Object) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
IsValidParameterSet | Tests whether the provided values are valid parameters for this distribution. | |
MeanMarginal | Returns the marginal distribution for the mean of the NormalGamma distribution. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
PrecisionMarginal | Returns the marginal distribution for the precision of the NormalGamma distribution. | |
Sample | Generates a sample from the NormalGamma distribution. | |
Sample(Random, Double, Double, Double, Double) | Generates a sample from the NormalGamma distribution. | |
Samples | Generates a sequence of samples from the NormalGamma distribution | |
Samples(Random, Double, Double, Double, Double) | Generates a sequence of samples from the NormalGamma distribution | |
ToString |
A string representation of the distribution.
(Overrides ObjectToString) |