IndependentTDistribution, TObservation, TOptions Class |
Namespace: Accord.Statistics.Distributions.Multivariate
[SerializableAttribute] public class Independent<TDistribution, TObservation, TOptions> : Independent<TDistribution, TObservation>, IFittableDistribution<TObservation[], IndependentOptions<TOptions>>, IFittable<TObservation[], IndependentOptions<TOptions>>, IFittable<TObservation[]>, IFittableDistribution<TObservation[]>, IDistribution<TObservation[]>, IDistribution, ICloneable, ISampleableDistribution<TObservation[]>, IRandomNumberGenerator<TObservation[]> where TDistribution : Object, IFittableDistribution<TObservation, TOptions>, IUnivariateDistribution<TObservation>, IUnivariateDistribution where TOptions : class, new(), IFittingOptions
The IndependentTDistribution, TObservation, TOptions type exposes the following members.
Name | Description | |
---|---|---|
IndependentTDistribution, TObservation, TOptions(TDistribution) |
Initializes a new instance of the IndependentTDistribution class.
| |
IndependentTDistribution, TObservation, TOptions(Int32, FuncTDistribution) |
Initializes a new instance of the IndependentTDistribution class.
| |
IndependentTDistribution, TObservation, TOptions(Int32, FuncInt32, TDistribution) |
Initializes a new instance of the IndependentTDistribution class.
| |
IndependentTDistribution, TObservation, TOptions(Int32, TDistribution) |
Initializes a new instance of the IndependentTDistribution class.
|
Name | Description | |
---|---|---|
Components |
Gets the components of this joint distribution.
(Inherited from IndependentTDistribution.) | |
Covariance |
Gets the variance-covariance matrix for this distribution.
(Inherited from IndependentTDistribution.) | |
Dimension |
Gets the number of variables for this distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Item |
Gets or sets the components of this joint distribution.
(Inherited from IndependentTDistribution.) | |
Mean |
Gets the mean for this distribution.
(Inherited from IndependentTDistribution.) | |
Median |
Gets the median for this distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Mode |
Gets the mode for this distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Variance |
Gets the variance for this distribution.
(Inherited from IndependentTDistribution.) |
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
(Inherited from IndependentTDistribution, TObservation.) | |
ComplementaryDistributionFunction(TObservation) |
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 IndependentTDistribution, TObservation.) | |
ComplementaryDistributionFunction(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 MultivariateContinuousDistribution.) | |
DistributionFunction(TObservation) |
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Inherited from IndependentTDistribution, TObservation.) | |
DistributionFunction(Double) |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from MultivariateContinuousDistribution.) | |
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.) | |
Fit(TObservation) |
Fits the underlying distribution to a given set of observations.
(Inherited from IndependentTDistribution, TObservation.) | |
Fit(Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from MultivariateContinuousDistribution.) | |
Fit(TObservation, Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from IndependentTDistribution, TObservation.) | |
Fit(Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from MultivariateContinuousDistribution.) | |
Fit(Double, Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from MultivariateContinuousDistribution.) | |
Fit(Double, Int32) |
Fits the underlying distribution to a given set of observations.
(Inherited from MultivariateContinuousDistribution.) | |
Fit(Double, Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from IndependentTDistribution.) | |
Fit(Double, Double, IndependentOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from IndependentTDistribution.) | |
Fit(TObservation, Double, IndependentOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from IndependentTDistribution, TObservation.) | |
Fit(TObservation, Double, IndependentOptionsTOptions) |
Fits the underlying distribution to a given set of observations.
| |
Fit(Double, Int32, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from MultivariateContinuousDistribution.) | |
Generate |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(TObservation) |
Generates a random observation from the current distribution.
(Inherited from IndependentTDistribution, TObservation.) | |
Generate(Double) |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32) |
Generates a random vector of observations from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32) |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Random) |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, TObservation) |
Generates a random vector of observations from the current distribution.
(Inherited from IndependentTDistribution, TObservation.) | |
Generate(TObservation, Random) |
Generates a random observation from the current distribution.
(Inherited from IndependentTDistribution, TObservation.) | |
Generate(Double, Random) |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, Double) |
Generates a random vector of observations from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, Int32) |
Generates a random vector of observations from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, Random) |
Generates a random observation from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
Generate(Int32, Double, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from IndependentTDistribution.) | |
Generate(Int32, TObservation, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from IndependentTDistribution, TObservation.) | |
Generate(Int32, Int32, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from MultivariateContinuousDistribution.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InnerComplementaryDistributionFunction |
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 MultivariateContinuousDistribution.) | |
InnerDistributionFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from IndependentTDistribution.) | |
InnerLogProbabilityDensityFunction |
Gets the log-probability density function (pdf)
for this distribution evaluated at point x.
(Inherited from IndependentTDistribution.) | |
InnerProbabilityDensityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from IndependentTDistribution.) | |
LogProbabilityDensityFunction |
Gets the log-probability density function (pdf)
for this distribution evaluated at point x.
(Inherited from MultivariateContinuousDistribution.) | |
LogProbabilityFunction |
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 IndependentTDistribution, TObservation.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ProbabilityDensityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from MultivariateContinuousDistribution.) | |
ProbabilityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from IndependentTDistribution, TObservation.) | |
Reset |
Resets cached values (should be called after re-estimation).
(Inherited from IndependentTDistribution.) | |
ToString |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(IFormatProvider) |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(String) |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(String, IFormatProvider) |
Returns a String that represents this instance.
(Inherited from IndependentTDistribution.) |
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.) |
In probability and statistics, given at least two random variables X, Y, ..., that are defined on a probability space, the joint probability distribution for X, Y, ... is a probability distribution that gives the probability that each of X, Y, ... falls in any particular range or discrete set of values specified for that variable. In the case of only two random variables, this is called a bivariate distribution, but the concept generalizes to any number of random variables, giving a multivariate distribution.
References:
The following example shows how to declare and initialize an Independent Joint Gaussian Distribution using known means and variances for each component.
// Declare two normal distributions NormalDistribution pa = new NormalDistribution(4.2, 1); // p(a) NormalDistribution pb = new NormalDistribution(7.0, 2); // p(b) // Now, create a joint distribution combining these two: var joint = new Independent<NormalDistribution>(pa, pb); // This distribution assumes the distributions of the two components are independent, // i.e. if we have 2D input vectors on the form {a, b}, then p({a,b}) = p(a) * p(b). // Lets check a simple example. Consider a 2D input vector x = { 4.2, 7.0 } as // double[] x = new double[] { 4.2, 7.0 }; // Those two should be completely equivalent: double p1 = joint.ProbabilityDensityFunction(x); double p2 = pa.ProbabilityDensityFunction(x[0]) * pb.ProbabilityDensityFunction(x[1]); bool equal = p1 == p2; // at this point, equal should be true.
The following example shows how to fit a distribution (estimate its parameters) from a given dataset.
// Let's consider an input dataset of 2D vectors. We would // like to estimate an Independent<NormalDistribution> // which best models this data. double[][] data = { // x, y new double[] { 1, 8 }, new double[] { 2, 6 }, new double[] { 5, 7 }, new double[] { 3, 9 }, }; // We start by declaring some initial guesses for the // distributions of each random variable (x, and y): // var distX = new NormalDistribution(0, 1); var distY = new NormalDistribution(0, 1); // Next, we declare our initial guess Independent distribution var joint = new Independent<NormalDistribution>(distX, distY); // We can now fit the distribution to our data, // producing an estimate of its parameters: // joint.Fit(data); // At this point, we have estimated our distribution. double[] mean = joint.Mean; // should be { 2.75, 7.50 } double[] var = joint.Variance; // should be { 2.917, 1.667 } // | 2.917, 0.000 | double[,] cov = joint.Covariance; // Cov = | | // | 0.000, 1.667 | // The covariance matrix is diagonal, as it would be expected // if is assumed there are no interactions between components.