DistributionAnalysis Class |
Namespace: Accord.Statistics.Analysis
The DistributionAnalysis type exposes the following members.
Name | Description | |
---|---|---|
DistributionAnalysis |
Initializes a new instance of the DistributionAnalysis class.
| |
DistributionAnalysis(Double) | Obsolete.
Initializes a new instance of the DistributionAnalysis class.
|
Name | Description | |
---|---|---|
AndersonDarling |
Gets the Anderson-Darling tests
performed against each of the candidate distributions.
| |
AndersonDarlingRank |
Gets the rank of each distribution according to the Anderson-Darling
test statistic. A value of 0 means the distribution is the most likely.
| |
ChiSquare |
Gets the Chi-Square tests
performed against each of the candidate distributions.
| |
ChiSquareRank |
Gets the rank of each distribution according to the Chi-Square
test statistic. A value of 0 means the distribution is the most likely.
| |
DistributionNames |
Gets the tested distribution names.
| |
Distributions |
Gets the estimated distributions.
| |
GoodnessOfFit |
Gets the goodness of fit for each candidate distribution.
| |
KolmogorovSmirnov |
Gets the Kolmogorov-Smirnov tests
performed against each of the candidate distributions.
| |
KolmogorovSmirnovRank |
Gets the rank of each distribution according to the Kolmogorov-Smirnov
test statistic. A value of 0 means the distribution is the most likely.
| |
Options |
Gets or sets a mapping of fitting options that should be
used when attempting to estimate each of the distributions
in Distributions.
|
Name | Description | |
---|---|---|
Compute | Obsolete.
Obsolete. Please use the Learn(Double, Double) method instead.
| |
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.) | |
GetFirstIndex |
Gets the index of the first distribution with the given name.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetMultivariateDistributions |
Gets all multivariate distributions (types implementing
IMultivariateDistribution) loaded in the
current domain.
| |
GetName |
Gets a distribution's name in a human-readable form.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUnivariateDistributions |
Gets all univariate distributions (types implementing
IUnivariateDistribution) loaded in the
current domain.
| |
Learn |
Learns a model that can map the given inputs to the desired outputs.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(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.) | |
ToT | 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.) |
// 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