@ -40,16 +40,6 @@ namespace MathNet.Numerics.Distributions
/// </summary>
public struct MeanPrecisionPair
{
/// <summary>
/// The mean value.
/// </summary>
double _ mean ;
/// <summary>
/// The precision value.
/// </summary>
double _ precision ;
/// <summary>
/// Initializes a new instance of the <see cref="MeanPrecisionPair"/> struct.
/// </summary>
@ -57,27 +47,19 @@ namespace MathNet.Numerics.Distributions
/// <param name="p">The precision of the pair.</param>
public MeanPrecisionPair ( double m , double p )
{
_ m ean = m ;
_ p recision = p ;
M ean = m ;
P recision = p ;
}
/// <summary>
/// Gets or sets the mean of the pair.
/// </summary>
public double Mean
{
get { return _ mean ; }
set { _ mean = value ; }
}
public double Mean { get ; set ; }
/// <summary>
/// Gets or sets the precision of the pair.
/// </summary>
public double Precision
{
get { return _ precision ; }
set { _ precision = value ; }
}
public double Precision { get ; set ; }
}
/// <summary>
@ -170,42 +152,30 @@ namespace MathNet.Numerics.Distributions
/// <summary>
/// Gets the location of the mean.
/// </summary>
public double MeanLocation
{
get { return _ meanLocation ; }
}
public double MeanLocation = > _ meanLocation ;
/// <summary>
/// Gets the scale of the mean.
/// </summary>
public double MeanScale
{
get { return _ meanScale ; }
}
public double MeanScale = > _ meanScale ;
/// <summary>
/// Gets the shape of the precision.
/// </summary>
public double PrecisionShape
{
get { return _ precisionShape ; }
}
public double PrecisionShape = > _ precisionShape ;
/// <summary>
/// Gets the inverse scale of the precision.
/// </summary>
public double PrecisionInverseScale
{
get { return _ precisionInvScale ; }
}
public double PrecisionInverseScale = > _ precisionInvScale ;
/// <summary>
/// Gets or sets the random number generator which is used to draw random samples.
/// </summary>
public System . Random RandomSource
{
get { return _ random ; }
set { _ random = value ? ? SystemRandomSource . Default ; }
get = > _ random ;
set = > _ random = value ? ? SystemRandomSource . Default ;
}
/// <summary>
@ -235,19 +205,13 @@ namespace MathNet.Numerics.Distributions
/// Gets the mean of the distribution.
/// </summary>
/// <value>The mean of the distribution.</value>
public MeanPrecisionPair Mean
{
get { return double . IsPositiveInfinity ( _ precisionInvScale ) ? new MeanPrecisionPair ( _ meanLocation , _ precisionShape ) : new MeanPrecisionPair ( _ meanLocation , _ precisionShape / _ precisionInvScale ) ; }
}
public MeanPrecisionPair Mean = > double . IsPositiveInfinity ( _ precisionInvScale ) ? new MeanPrecisionPair ( _ meanLocation , _ precisionShape ) : new MeanPrecisionPair ( _ meanLocation , _ precisionShape / _ precisionInvScale ) ;
/// <summary>
/// Gets the variance of the distribution.
/// </summary>
/// <value>The mean of the distribution.</value>
public MeanPrecisionPair Variance
{
get { return new MeanPrecisionPair ( _ precisionInvScale / ( _ meanScale * ( _ precisionShape - 1 ) ) , _ precisionShape / Math . Sqrt ( _ precisionInvScale ) ) ; }
}
public MeanPrecisionPair Variance = > new MeanPrecisionPair ( _ precisionInvScale / ( _ meanScale * ( _ precisionShape - 1 ) ) , _ precisionShape / Math . Sqrt ( _ precisionInvScale ) ) ;
/// <summary>
/// Evaluates the probability density function for a NormalGamma distribution.