Click or drag to resize
Accord.NET (logo)

WishartDistribution Class

Wishart Distribution.
Inheritance Hierarchy
SystemObject
  Accord.Statistics.DistributionsDistributionBase
    Accord.Statistics.Distributions.MultivariateMatrixContinuousDistribution
      Accord.Statistics.Distributions.MultivariateWishartDistribution

Namespace:  Accord.Statistics.Distributions.Multivariate
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class WishartDistribution : MatrixContinuousDistribution
Request Example View Source

The WishartDistribution type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyCovariance
Gets the variance-covariance matrix for this distribution.
(Overrides MatrixContinuousDistributionCovariance.)
Public propertyDegreesOfFreedom
Gets the degrees of freedom for this Wishart distribution.
Public propertyDimension
Gets the number of variables for this distribution.
(Inherited from MatrixContinuousDistribution.)
Public propertyMean
Gets the mean for this distribution.
(Overrides MatrixContinuousDistributionMean.)
Public propertyMedian
Gets the median for this distribution.
(Inherited from MatrixContinuousDistribution.)
Public propertyMode
Gets the mode for this distribution.
(Inherited from MatrixContinuousDistribution.)
Public propertyNumberOfColumns
Gets the number of columns that matrices from this distribution should have.
(Inherited from MatrixContinuousDistribution.)
Public propertyNumberOfRows
Gets the number of rows that matrices from this distribution should have.
(Inherited from MatrixContinuousDistribution.)
Public propertyVariance
Gets the variance for this distribution.
(Overrides MatrixContinuousDistributionVariance.)
Top
Methods
  NameDescription
Public methodClone
Creates a new object that is a copy of the current instance.
(Overrides DistributionBaseClone.)
Public methodComplementaryDistributionFunction(Double)
Gets the complementary cumulative distribution function (ccdf) for this distribution evaluated at point x. This function is also known as the Survival function.
(Inherited from MatrixContinuousDistribution.)
Public methodComplementaryDistributionFunction(Double)
Gets the complementary cumulative distribution function (ccdf) for this distribution evaluated at point x. This function is also known as the Survival function.
(Inherited from MatrixContinuousDistribution.)
Public methodDistributionFunction(Double)
Gets the probability density function (pdf) for this distribution evaluated at point x.
(Inherited from MatrixContinuousDistribution.)
Public methodDistributionFunction(Double)
Gets the cumulative distribution function (cdf) for this distribution evaluated at point x.
(Inherited from MatrixContinuousDistribution.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFit(Double)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, Double)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, Int32)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, Double)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, Int32, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Inherited from MatrixContinuousDistribution.)
Public methodFit(Double, Double, IFittingOptions)
Fits the underlying distribution to a given set of observations.
(Overrides MatrixContinuousDistributionFit(Double, Double, IFittingOptions).)
Public methodGenerate
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Double)
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Double)
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32)
Generates a random vector of observations from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Random)
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Double, Random)
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Double, Random)
Generates a random observation from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32, Double)
Generates a random vector of observations from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32, Double)
Generates a random vector of observations from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32, Random)
Generates a random vector of observations from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32, Double, Random)
Generates a random vector of observations from the current distribution.
(Inherited from MatrixContinuousDistribution.)
Public methodGenerate(Int32, Double, Random)
Generates a random vector of observations from the current distribution.
(Overrides MatrixContinuousDistributionGenerate(Int32, Double, Random).)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodInnerComplementaryDistributionFunction
Gets the complementary cumulative distribution function (ccdf) for this distribution evaluated at point x. This function is also known as the Survival function.
(Inherited from MatrixContinuousDistribution.)
Protected methodInnerDistributionFunction
Unsupported.
(Overrides MatrixContinuousDistributionInnerDistributionFunction(Double).)
Protected methodInnerLogProbabilityDensityFunction
Gets the log-probability density function (pdf) for this distribution evaluated at point x.
(Overrides MatrixContinuousDistributionInnerLogProbabilityDensityFunction(Double).)
Protected methodInnerProbabilityDensityFunction
Gets the probability density function (pdf) for this distribution evaluated at point x.
(Overrides MatrixContinuousDistributionInnerProbabilityDensityFunction(Double).)
Public methodLogProbabilityDensityFunction
Gets the log-probability density function (pdf) for this distribution evaluated at point x.
(Inherited from MatrixContinuousDistribution.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProbabilityDensityFunction
Gets the probability density function (pdf) for this distribution evaluated at point x.
(Inherited from MatrixContinuousDistribution.)
Public methodStatic memberRandom(Int32, Double)
Generates a random vector of observations from the current distribution.
Public methodStatic memberRandom(Int32, Double, Random)
Generates a random vector of observations from the current distribution.
Public methodStatic memberRandom(Int32, Int32, Double)
Generates a random vector of observations from the current distribution.
Public methodStatic memberRandom(Int32, Int32, Double, Random)
Generates a random vector of observations from the current distribution.
Public methodStatic memberRandom(Int32, Int32, Double, Double, Random)
Generates a random vector of observations from the current distribution.
Public methodToString
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(IFormatProvider)
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(String)
Returns a String that represents this instance.
(Inherited from DistributionBase.)
Public methodToString(String, IFormatProvider)
Returns a String that represents this instance.
(Overrides DistributionBaseToString(String, IFormatProvider).)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks
Examples
// Create a Wishart distribution with the parameters:
WishartDistribution wishart = new WishartDistribution(

    // Degrees of freedom
    degreesOfFreedom: 7,

    // Scale parameter
    scale: new double[,] 
    {
        { 4, 1, 1 },  
        { 1, 2, 2 },  // (must be symmetric and positive definite)
        { 1, 2, 6 },
    }
);

// Common measures
double[] var = wishart.Variance;  // { 224, 56, 504 }
double[,] cov = wishart.Covariance;   // see below
double[,] meanm = wishart.MeanMatrix; // see below

//         224  63  175             28  7   7 
//   cov =  63  56  112     mean =   7  14  14
//         175 112  504              7  14  42

// (the above matrix representations have been transcribed to text using)
string scov = cov.ToString(DefaultMatrixFormatProvider.InvariantCulture);
string smean = meanm.ToString(DefaultMatrixFormatProvider.InvariantCulture);

// For compatibility reasons, .Mean stores a flattened mean matrix
double[] mean = wishart.Mean; // { 28, 7, 7, 7, 14, 14, 7, 14, 42 }


// Probability density functions
double pdf = wishart.ProbabilityDensityFunction(new double[,] 
{
    { 8, 3, 1 },
    { 3, 7, 1 },   //   0.000000011082455043473361
    { 1, 1, 8 },
});

double lpdf = wishart.LogProbabilityDensityFunction(new double[,] 
{
    { 8, 3, 1 },
    { 3, 7, 1 },   // -18.317902605850534
    { 1, 1, 8 },
});
See Also