Univariate Class

Contains methods for analyzing univariate samples.

Definition

Namespace: Meta.Numerics.Statistics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static class Univariate
Inheritance
Object    Univariate

Remarks

This is the central class for the analysis of univariate samples of independent, identically distributed values.

To compute moments of the sample data, you can use methods such as Mean, Variance, RawMoment, and CentralMoment. Note that these are moments of the sample data, not estimates of the moments of the underlying population from which the sample was drawn.

To obtain estimates of the moments of the underlying population from which the sample was drawn, you can use methods such as PopulationMean, PopulationStandardDeviation, PopulationRawMoment, and PopulationCentralMoment. These estimates all come with associated error bars, so they return UncertainValue structures.

You can fit a sample to any number of distributions using methods such as FitToExponential(IReadOnlyListDouble), FitToLognormal(IReadOnlyListDouble), FitToNormal(IReadOnlyListDouble), FitToWeibull(IReadOnlyListDouble).

You can perform statistical tests on a single sample, such as the StudentTTest(IReadOnlyCollectionDouble, Double) or SignTest(IReadOnlyCollectionDouble, Double) to compare a sample to a reference value, or the ShapiroFranciaTest(IReadOnlyListDouble) to test a sample for normality. You can also perform statistical tests comparing multiple samples, such as the two-sample StudentTTest(IReadOnlyCollectionDouble, IReadOnlyCollectionDouble), and MannWhitneyTest(IReadOnlyListDouble, IReadOnlyListDouble), or the multi-sample OneWayAnovaTest(IReadOnlyCollectionDouble) and KruskalWallisTest(IReadOnlyListDouble).

Most of the methods in this class are extension methods that accept as a sample any type that implements the appropriate collection interface. So, for example, given sample values in a List<string> named s, you could estimate the variance of the population from which it was drawn either by s.PopulationVariance() or Univariate.PopulationVariance(s).

Methods

CentralMoment Computes the given sample central moment.
ChiSquaredTest Tests whether the sample is compatible with the given discrete distribution.
CorrectedStandardDeviation Computes the Bessel-corrected standard deviation.
FisherFTest Tests whether the variances of two samples are compatible.
FitToBeta Finds the Beta distribution that best fits the given sample.
FitToExponential Finds the exponential distribution that best fits the given sample.
FitToGamma Finds the Gamma distribution that best fits the given sample.
FitToGumbel Find the Gumbel distribution that best fit the given sample.
FitToLognormal Finds the log-normal distribution that best fits the given sample.
FitToNormal Finds the normal distribution that best fits the given sample.
FitToRayleigh Finds the Rayleigh distribution that best fits the given sample.
FitToWald Finds the Wald distribution that best fits a sample.
FitToWeibull Finds the Weibull distribution that best fits the given sample.
InterquartileRange Finds the interquartile range.
InverseLeftProbability Finds the sample value corresponding to a given percentile.
KolmogorovSmirnovTest(IReadOnlyListDouble, ContinuousDistribution) Tests whether the sample is compatible with the given distribution.
KolmogorovSmirnovTest(IReadOnlyListDouble, IReadOnlyListDouble) Tests whether the sample is compatible with another sample.
KruskalWallisTest(IReadOnlyListIReadOnlyListDouble) Performs a Kruskal-Wallis test on the given samples.
KruskalWallisTest(IReadOnlyListDouble) Performs a Kruskal-Wallis test on the given samples.
KuiperTest Tests whether the sample is compatible with the given distribution.
LeftProbability Gets the fraction of values equal to or less than the given value.
MannWhitneyTest Tests whether one sample median is compatible with another sample median.
Maximum Finds the maximum value.
MaximumLikelihoodFit Finds the parameters that make an arbitrary, parameterized distribution best fit the sample.
Mean Computes the sample mean.
Median Finds the median.
Minimum Finds the minimum value.
OneWayAnovaTest(IReadOnlyCollectionIReadOnlyCollectionDouble) Performs a one-way analysis of variance (ANOVA).
OneWayAnovaTest(IReadOnlyCollectionDouble) Performs a one-way analysis of variance (ANOVA).
PopulationCentralMoment Estimates the given central moment of the underlying population.
PopulationMean Estimates the mean of the underlying population.
PopulationRawMoment Estimates the given raw moment of the underlying population.
PopulationStandardDeviation Estimates of the standard deviation of the underlying population.
PopulationVariance Estimates of the variance of the underlying population.
RawMoment Computes the given sample raw moment.
ShapiroFranciaTest Performs a Shapiro-Francia test of normality on the sample.
SignTest Tests whether the sample median is compatible with the given reference value.
Skewness Computes the sample skewness.
StandardDeviation Computes the sample standard deviation.
StudentTTest(IReadOnlyCollectionDouble, IReadOnlyCollectionDouble) Tests whether one sample mean is compatible with another sample mean.
StudentTTest(IReadOnlyCollectionDouble, Double) Tests whether the sample mean is compatible with the reference mean.
Trimean Finds the tri-mean.
TwoWayAnovaTest Performs a two-way analysis of variance.
Variance Computes the sample variance.
ZTest Performs a z-test to test whether the given sample is compatible with the given normal reference population.

See Also