GeneralContinuousDistribution Class |
Namespace: Accord.Statistics.Distributions.Univariate
The GeneralContinuousDistribution type exposes the following members.
Name | Description | |
---|---|---|
GeneralContinuousDistribution(UnivariateContinuousDistribution) |
Creates a new GeneralContinuousDistribution with the given PDF and CDF functions.
| |
GeneralContinuousDistribution(DoubleRange, FuncDouble, Double, FuncDouble, Double) |
Creates a new GeneralContinuousDistribution with the given PDF and CDF functions.
|
Name | Description | |
---|---|---|
Entropy |
Gets the entropy for this distribution.
(Overrides UnivariateContinuousDistributionEntropy.) | |
Mean |
Gets the mean for this distribution.
(Overrides UnivariateContinuousDistributionMean.) | |
Median |
Gets the median for this distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Mode |
Gets the mode for this distribution.
(Overrides UnivariateContinuousDistributionMode.) | |
Quartiles |
Gets the Quartiles for this distribution.
(Inherited from UnivariateContinuousDistribution.) | |
StandardDeviation |
Gets the Standard Deviation (the square root of
the variance) for the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Support |
Gets the support interval for this distribution.
(Overrides UnivariateContinuousDistributionSupport.) | |
Variance |
Gets the variance for this distribution.
(Overrides UnivariateContinuousDistributionVariance.) |
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
(Overrides DistributionBaseClone.) | |
ComplementaryDistributionFunction |
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 UnivariateContinuousDistribution.) | |
CumulativeHazardFunction |
Gets the cumulative hazard function for this
distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
DistributionFunction(Double) |
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
DistributionFunction(Double, Double) |
Gets the cumulative distribution function (cdf) for this
distribution in the semi-closed interval (a; b] given as
P(a < X ≤ b).
(Inherited from UnivariateContinuousDistribution.) | |
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(Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Int32) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Int32, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
FromDensityFunction(FuncDouble, Double) |
Creates a new GeneralContinuousDistribution
using only a probability density function definition.
| |
FromDensityFunction(DoubleRange, FuncDouble, Double) |
Creates a new GeneralContinuousDistribution
using only a probability density function definition.
| |
FromDensityFunction(DoubleRange, FuncDouble, Double, IUnivariateIntegration) |
Creates a new GeneralContinuousDistribution
using only a probability density function definition.
| |
FromDistribution |
Creates a new GeneralContinuousDistribution
from an existing
continuous distribution.
| |
FromDistributionFunction(FuncDouble, Double) |
Creates a new GeneralContinuousDistribution
using only a cumulative distribution function definition.
| |
FromDistributionFunction(DoubleRange, FuncDouble, Double) |
Creates a new GeneralContinuousDistribution
using only a cumulative distribution function definition.
| |
FromDistributionFunction(DoubleRange, FuncDouble, Double, IUnivariateIntegration) |
Creates a new GeneralContinuousDistribution
using only a cumulative distribution function definition.
| |
Generate |
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Random) |
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Double) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Double, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetRange |
Gets the distribution range within a given percentile.
(Inherited from UnivariateContinuousDistribution.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HazardFunction |
Gets the hazard function, also known as the failure rate or
the conditional failure density function for this distribution
evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
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 UnivariateContinuousDistribution.) | |
InnerDistributionFunction |
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerDistributionFunction(Double).) | |
InnerInverseDistributionFunction |
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.) | |
InnerLogProbabilityDensityFunction |
Gets the log-probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
InnerProbabilityDensityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerProbabilityDensityFunction(Double).) | |
InverseDistributionFunction |
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.) | |
LogCumulativeHazardFunction |
Gets the log of the cumulative hazard function for this
distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
LogProbabilityDensityFunction |
Gets the log-probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
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 UnivariateContinuousDistribution.) | |
QuantileDensityFunction |
Gets the first derivative of the
inverse distribution function (icdf) for this distribution evaluated
at probability p.
(Inherited from UnivariateContinuousDistribution.) | |
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.
(Overrides DistributionBaseToString(String, IFormatProvider).) |
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.) |
The general continuous distribution provides the automatic calculation for a variety of distribution functions and measures given only definitions for the Probability Density Function (PDF) or the Cumulative Distribution Function (CDF). Values such as the Expected value, Variance, Entropy and others are computed through numeric integration.
// Let's suppose we have a formula that defines a probability distribution // but we dont know much else about it. We don't know the form of its cumulative // distribution function, for example. We would then like to know more about // it, such as the underlying distribution's moments, characteristics, and // properties. // Let's suppose the formula we have is this one: double mu = 5; double sigma = 4.2; Func>double, double> df = x => 1.0 / (sigma * Math.Sqrt(2 * Math.PI)) * Math.Exp(-Math.Pow(x - mu, 2) / (2 * sigma * sigma)); // And for the moment, let's also pretend we don't know it is actually the // p.d.f. of a Gaussian distribution with mean 5 and std. deviation of 4.2. // So, let's create a distribution based _solely_ on the formula we have: var distribution = GeneralContinuousDistribution.FromDensityFunction(df); // Now, we can check everything that we can know about it: double mean = distribution.Mean; // 5 (note that all of those have been double median = distribution.Median; // 5 detected automatically simply from double var = distribution.Variance; // 17.64 the given density formula through double mode = distribution.Mode; // 5 numerical methods) double cdf = distribution.DistributionFunction(x: 1.4); // 0.19568296915377595 double pdf = distribution.ProbabilityDensityFunction(x: 1.4); // 0.065784567984404935 double lpdf = distribution.LogProbabilityDensityFunction(x: 1.4); // -2.7213699972695058 double ccdf = distribution.ComplementaryDistributionFunction(x: 1.4); // 0.80431703084622408 double icdf = distribution.InverseDistributionFunction(p: cdf); // 1.3999999997024655 double hf = distribution.HazardFunction(x: 1.4); // 0.081789351041333558 double chf = distribution.CumulativeHazardFunction(x: 1.4); // 0.21776177055276186