Click or drag to resize
Accord.NET (logo)

DistributionAnalysis Class

Distribution fitness analysis.
Inheritance Hierarchy
SystemObject
  Accord.Statistics.AnalysisDistributionAnalysis

Namespace:  Accord.Statistics.Analysis
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class DistributionAnalysis
Request Example View Source

The DistributionAnalysis type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyAndersonDarling
Gets the Anderson-Darling tests performed against each of the candidate distributions.
Public propertyAndersonDarlingRank
Gets the rank of each distribution according to the Anderson-Darling test statistic. A value of 0 means the distribution is the most likely.
Public propertyChiSquare
Gets the Chi-Square tests performed against each of the candidate distributions.
Public propertyChiSquareRank
Gets the rank of each distribution according to the Chi-Square test statistic. A value of 0 means the distribution is the most likely.
Public propertyDistributionNames
Gets the tested distribution names.
Public propertyDistributions
Gets the estimated distributions.
Public propertyGoodnessOfFit
Gets the goodness of fit for each candidate distribution.
Public propertyKolmogorovSmirnov
Gets the Kolmogorov-Smirnov tests performed against each of the candidate distributions.
Public propertyKolmogorovSmirnovRank
Gets the rank of each distribution according to the Kolmogorov-Smirnov test statistic. A value of 0 means the distribution is the most likely.
Public propertyOptions
Gets or sets a mapping of fitting options that should be used when attempting to estimate each of the distributions in Distributions.
Top
Methods
  NameDescription
Public methodCompute Obsolete.
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 methodGetFirstIndex
Gets the index of the first distribution with the given name.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetMultivariateDistributions
Gets all multivariate distributions (types implementing IMultivariateDistribution) loaded in the current domain.
Public methodStatic memberGetName
Gets a distribution's name in a human-readable form.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetUnivariateDistributions
Gets all univariate distributions (types implementing IUnivariateDistribution) loaded in the current domain.
Public methodLearn
Learns a model that can map the given inputs to the desired outputs.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
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
The distribution analysis class can be used to perform a battery of distribution fitting tests in order to check from which distribution a sample is more likely to have come from.
Examples
// Let's say we would like to check from which possible 
// distribution a given sample might have come from. 
double[] x = { -1, 2, 5, 3, 2, 1, 4, 32, 0, 2, 4 };

// Create a distribution analysis
var da = new DistributionAnalysis();

// Learn the analysis
var fit = da.Learn(x);

// Get the most likely distribution amongst the ones that 
// have been tried (by default, only a few are tested)
var mostLikely1 = fit[0].Distribution; // N(x; μ = 4.9, σ² = 83.9)

// Sometimes it might be the case that we would like to
// test against some other distributions than the default
// ones. We can add them to the list of tested distributions:
da.Distributions.Add(new VonMisesDistribution(1.0));

// and re-learn the analysis
fit = da.Learn(x);

var mostLikely2 = fit[0].Distribution; // VonMises(x; μ = 1.92, κ = 0.18)

// it is also possible to specify different sample 
// weights (but not all distributions support it)
double[] w = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0, 0.1, 0.1, 0.1 };

// and re-learn the analysis with weights
fit = da.Learn(x, w);

var mostLikely3 = fit[0].Distribution; // VonMises(x; μ = 2.81, κ = 0.25
See Also