Sample Class

Represents a set of data points, where each data point consists of a single real number.

Definition

Namespace: Meta.Numerics.Statistics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public sealed class Sample : ICollection<double>, 
	IEnumerable<double>, IEnumerable, IReadOnlyCollection<double>, 
	IReadOnlyList<double>
Inheritance
Object    Sample
Implements
ICollectionDouble, IEnumerableDouble, IReadOnlyCollectionDouble, IReadOnlyListDouble, IEnumerable

Remarks

A univariate sample is a data set which records one number for each independent observation. For example, data from a study which measured the weight of each subject could be stored in the Sample class. The class offers descriptive statistics for the sample, estimates of descriptive statistics of the underlying population distribution, and statistical tests to compare the sample distribution to other sample distributions or theoretical models.

NOTE: This class will be retired in a future release. Its functionality is replaced by the Univariate class, which can operatate on arbitrary data lists.

Constructors

Sample Initializes a new, empty sample.
Sample(Double) Initializes a new sample from a list of values.
Sample(IEnumerableDouble) Initializes a new sample from a list of values.
Sample(String) Initializes a new, empty sample with the given name.

Properties

CorrectedStandardDeviation Gets the Bessel-corrected standard deviation.
Count Gets the number of values in the sample.
InterquartileRange Gets the interquartile range of sample measurements.
IsReadOnly Gets a value indicating whether the sample is read-only.
Maximum Gets the largest value in the sample.
Mean Gets the sample mean.
Median Gets the sample median.
Minimum Gets the smallest value in the sample.
Name Gets or sets the name of the sample.
PopulationMean Gets an estimate of the population mean from the sample.
PopulationStandardDeviation Gets an estimate of the population standard deviation from the sample.
PopulationVariance Gets an estimate of the population variance from the sample.
Skewness Gets the sample skewness.
StandardDeviation Gets the sample standard deviation.
Variance Gets the sample variance.

Methods

Add(Double) Adds a value to the sample.
Add(Double) Adds multiple values to the sample.
Add(IEnumerableDouble) Adds multiple values to the sample.
CentralMoment Computes the given sample central moment.
Clear Remove all values from the sample.
Contains Determines whether the sample contains the given value.
Copy Copies the sample.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FisherFTest Tests whether the variances of two samples are compatible.
GetEnumerator Gets an enumerator of sample values.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
InverseLeftProbability Gets the sample value corresponding to a given percentile score.
KolmogorovSmirnovTest(ContinuousDistribution) Tests whether the sample is compatible with the given distribution.
KolmogorovSmirnovTest(Sample, Sample) Tests whether the sample is compatible with another sample.
KruskalWallisTest(IReadOnlyListSample) Performs a Kruskal-Wallis test on the given samples.
KruskalWallisTest(Sample) 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.
MaximumLikelihoodFit Performs a maximum likelihood fit.
OneWayAnovaTest(IReadOnlyCollectionSample) Performs a one-way analysis of variance (ANOVA).
OneWayAnovaTest(Sample) Performs a one-way analysis of variance (ANOVA).
PopulationCentralMoment Estimates the given population central moment from the sample.
PopulationRawMoment Estimates the given population raw moment from the sample.
RawMoment Computes the given sample raw moment.
Remove Removes a given value from the sample.
ShapiroFranciaTest Performs a Shapiro-Francia test of normality on the sample.
SignTest Tests whether the sample median is compatible with the given reference value.
StudentTTest(Double) Tests whether the sample mean is compatible with the reference mean.
StudentTTest(Sample, Sample) Tests whether one sample mean is compatible with another sample mean.
ToStringReturns a string that represents the current object.
(Inherited from Object)
Transform Transforms all values using a user-supplied function.
TwoWayAnovaTest Performs a two-way analysis of variance.
ZTest Performs a z-test.

Extension Methods

Autocovariance Computes the auto-covariance for all lags.
(Defined by Series)
Autocovariance Computes the auto-covariance of the series at the given lag.
(Defined by Series)
CentralMoment Computes the given sample central moment.
(Defined by Univariate)
CorrectedStandardDeviation Computes the Bessel-corrected standard deviation.
(Defined by Univariate)
CorrelationCoefficient Computes the correlation coefficient between the two variables.
(Defined by Bivariate)
Covariance Computes the covariance of the two variables.
(Defined by Bivariate)
FitToAR1 Fits an AR(1) model to the time series.
(Defined by Series)
FitToBeta Finds the Beta distribution that best fits the given sample.
(Defined by Univariate)
FitToExponential Finds the exponential distribution that best fits the given sample.
(Defined by Univariate)
FitToGamma Finds the Gamma distribution that best fits the given sample.
(Defined by Univariate)
FitToGumbel Find the Gumbel distribution that best fit the given sample.
(Defined by Univariate)
FitToLognormal Finds the log-normal distribution that best fits the given sample.
(Defined by Univariate)
FitToMA1 Fits an MA(1) model to the time series.
(Defined by Series)
FitToNormal Finds the normal distribution that best fits the given sample.
(Defined by Univariate)
FitToRayleigh Finds the Rayleigh distribution that best fits the given sample.
(Defined by Univariate)
FitToWald Finds the Wald distribution that best fits a sample.
(Defined by Univariate)
FitToWeibull Finds the Weibull distribution that best fits the given sample.
(Defined by Univariate)
InterquartileRange Finds the interquartile range.
(Defined by Univariate)
InverseLeftProbability Finds the sample value corresponding to a given percentile.
(Defined by Univariate)
KolmogorovSmirnovTest Tests whether the sample is compatible with the given distribution.
(Defined by Univariate)
KuiperTest Tests whether the sample is compatible with the given distribution.
(Defined by Univariate)
LeftProbability Gets the fraction of values equal to or less than the given value.
(Defined by Univariate)
LinearRegression Computes the best-fit linear regression from the data.
(Defined by Bivariate)
LjungBoxTest Performs a Ljung-Box test for non-correlation.
(Defined by Series)
LjungBoxTest Performs a Ljung-Box test for non-correlation with the given number of lags.
(Defined by Series)
Maximum Finds the maximum value.
(Defined by Univariate)
MaximumLikelihoodFit Finds the parameters that make an arbitrary, parameterized distribution best fit the sample.
(Defined by Univariate)
Mean Computes the sample mean.
(Defined by Univariate)
Median Finds the median.
(Defined by Univariate)
Minimum Finds the minimum value.
(Defined by Univariate)
MultiLinearRegression Performs a multivariate linear regression on the named columns.
(Defined by Multivariate)
MultiLinearRegression Performs a multivariate linear regression.
(Defined by Multivariate)
NonlinearRegression Finds the parameterized function that best fits the data.
(Defined by Bivariate)
NonlinearRegression Finds the parameterized function that best fits the data.
(Defined by Bivariate)
PolynomialRegression Computes the polynomial of given degree which best fits the data.
(Defined by Bivariate)
PopulationCentralMoment Estimates the given central moment of the underlying population.
(Defined by Univariate)
PopulationCovariance Estimates the covariance of the two variables in the population.
(Defined by Bivariate)
PopulationMean Estimates the mean of the underlying population.
(Defined by Univariate)
PopulationRawMoment Estimates the given raw moment of the underlying population.
(Defined by Univariate)
PopulationStandardDeviation Estimates of the standard deviation of the underlying population.
(Defined by Univariate)
PopulationVariance Estimates of the variance of the underlying population.
(Defined by Univariate)
PowerSpectrum Computes the power spectrum of the time series.
(Defined by Series)
RawMoment Computes the given sample raw moment.
(Defined by Univariate)
SeriesPopulationStatistics Computes estimates for the moments of the population from which the time series is drawn.
(Defined by Series)
ShapiroFranciaTest Performs a Shapiro-Francia test of normality on the sample.
(Defined by Univariate)
SignTest Tests whether the sample median is compatible with the given reference value.
(Defined by Univariate)
Skewness Computes the sample skewness.
(Defined by Univariate)
StandardDeviation Computes the sample standard deviation.
(Defined by Univariate)
StudentTTest Tests whether the sample mean is compatible with the reference mean.
(Defined by Univariate)
Trimean Finds the tri-mean.
(Defined by Univariate)
Variance Computes the sample variance.
(Defined by Univariate)
ZTest Performs a z-test to test whether the given sample is compatible with the given normal reference population.
(Defined by Univariate)

See Also