statistics

statistics

1.5.4 2023-2-28

The Statistics package for GNU Octave.

Select Category:

Clustering

cluster Define clusters from an agglomerative hierarchical cluster tree.
clusterdata Wrapper function for 'linkage' and 'cluster'.
cmdscale Classical multidimensional scaling of a matrix.
confusionmat Compute a confusion matrix for classification problems
ConfusionMatrixChart Create object P, a Confusion Matrix Chart object.
cophenet Compute the cophenetic correlation coefficient.
evalclusters Create a clustering evaluation object to find the optimal number of clusters.
inconsistent Compute the inconsistency coefficient for each link of a hierarchical cluster tree.
kmeans Perform a K-means clustering of the NxD matrix DATA.
linkage Produce a hierarchical clustering dendrogram.
mahal Mahalanobis' D-square distance.
mhsample Draws NSAMPLES samples from a target stationary distribution PDF using Metropolis-Hastings algorithm.
optimalleaforder Compute the optimal leaf ordering of a hierarchical binary cluster tree.
pdist Return the distance between any two rows in X.
pdist2 Compute pairwise distance between two sets of vectors.
procrustes Procrustes Analysis.
slicesample Draws NSAMPLES samples from a target stationary distribution PDF using slice sampling of Radford M.
squareform Interchange between distance matrix and distance vector formats.

CVpartition (class of set partitions for cross-validation, used in crossval)

@cvpartition/cvpartition Create a partition object for cross validation.
@cvpartition/display Display a 'cvpartition' object, C.
@cvpartition/get Get a field, F, from a 'cvpartition' object, C.
@cvpartition/repartition Return a new cvpartition object.
@cvpartition/set Set FIELD, in a 'cvpartition' object, C.
@cvpartition/test Return logical vector for testing-subset indices from a 'cvpartition' object, C.
@cvpartition/training Return logical vector for training-subset indices from a 'cvpartition' object, C.

Data Manipulation

combnk Return all combinations of K elements in DATA.
crosstab Create a cross-tabulation (contingency table) T from data vectors.
datasample Randomly sample data.
fillmissing Replace missing entries of array A either with values in V or as determined by other specified methods. 'missing' values are determined by the data type of A as identified by the function ismissing, curently defined as:
grp2idx Get index for group variables.
ismissing Find missing data in a numeric or string array.
normalise_distribution Transform a set of data so as to be N(0,1) distributed according to an idea by van Albada and Robinson.
rmmissing Remove missing or incomplete data from an array.
standardizeMissing Replace data values specified by INDICATOR in A by the standard 'missing' data value for that data type.
tabulate Compute a frequency table.

Descriptive Statistics

cl_multinom Confidence level of multinomial portions.
geomean Compute the geometric mean of X.
grpstats Summary statistics by group. 'grpstats' computes groupwise summary statistics, for data in a matrix X. 'grpstats' treats NaNs as missing values, and removes them.
harmmean Compute the harmonic mean of X.
jackknife Compute jackknife estimates of a parameter taking one or more given samples as parameters.
mean Compute the mean of the elements of X.
median Compute the median value of the elements of X.
nanmax Find the maximal element while ignoring NaN values.
nanmin Find the minimal element while ignoring NaN values.
nansum Compute the sum while ignoring NaN values.
std Compute the standard deviation of the elements of X.
trimmean Compute the trimmed mean.
var Compute the variance of the elements of X.

Distributions

bbscdf Birnbaum-Saunders cumulative distribution function (CDF).
bbsinv Inverse of the Birnbaum-Saunders cumulative distribution function (iCDF).
bbspdf Birnbaum-Saunders probability density function (PDF).
bbsrnd Random arrays from the Birnbaum-Saunders distribution.
betacdf Beta cumulative distribution function (CDF).
betainv Inverse of the Beta distribution (iCDF).
betapdf Beta probability density function (PDF).
betarnd Random arrays from the Beta distribution.
binocdf Binomial cumulative distribution function (CDF).
binoinv Inverse of the Binomial cumulative distribution function (iCDF).
binopdf Binomial probability density function (PDF).
binornd Random arrays from the Binomial distribution
burrcdf Burr type XII cumulative distribution function (CDF).
burrinv Inverse of the Burr type XII cumulative distribution function (iCDF).
burrpdf Burr type XII probability density function (PDF).
burrrnd Random arrays from the Burr type XII distribution.
bvncdf Bivariate normal cumulative distribution function (CDF).
bvtcdf Bivariate Student's t cumulative distribution function (CDF).
cauchy_cdf Cauchy cumulative distribution function (CDF).
cauchy_inv Inverse of the Cauchy cumulative distribution function (iCDF).
cauchy_pdf Cauchy probability density function (PDF).
cauchy_rnd Random arrays from the Cauchy distribution.
chi2cdf Chi-square cumulative distribution function.
chi2inv Inverse of the Chi-square cumulative distribution function (iCDF).
chi2pdf Chi-square probability density function (PDF).
chi2rnd Random arrays from the Chi-square distribution.
copulacdf Copula family cumulative distribution functions (CDF).
copulapdf Copula family probability density functions (PDF).
copularnd Random arrays from the copula family distributions.
evcdf Extreme value cumulative distribution function (CDF).
evinv Inverse of the extreme value cumulative distribution function (iCDF).
evpdf Extreme value probability density function (PDF).
evrnd Random arrays from the extreme value distribution.
expcdf Exponential cumulative distribution function (CDF).
expinv Inverse of the exponential cumulative distribution function (iCDF).
exppdf Exponential probability density function (PDF).
exprnd Random arrays from the exponential distribution.
fcdf F cumulative distribution function (CDF).
finv Inverse of the F cumulative distribution function (iCDF).
fpdf F probability density function (PDF).
frnd Random arrays from the F distribution.
gamcdf Gamma cumulative distribution function (CDF).
gaminv Inverse of the Gamma cumulative distribution function (iCDF).
gampdf Gamma probability density function (PDF).
gamrnd Random arrays from the Gamma distribution.
geocdf Geometric cumulative distribution function (CDF).
geoinv Inverse of the geometric cumulative distribution function (iCDF).
geopdf Geometric probability density function (PDF).
geornd Random arrays from the geometric distribution.
gevcdf Generalized extreme value (GEV) cumulative distribution function (CDF).
gevinv Inverse of the generalized extreme value (GEV) cumulative distribution function (iCDF).
gevpdf Generalized extreme value (GEV) probability density function (PDF).
gevrnd Random arrays from the generalized extreme value (GEV) distribution.
gpcdf Generalized Pareto cumulative distribution function (cdf).
gpinv Inverse of the generalized Pareto cumulative distribution function (iCDF).
gppdf Generalized Pareto probability density function (PDF).
gprnd Random arrays from the generalized Pareto distribution.
hygecdf Hypergeometric cumulative distribution function (CDF).
hygeinv Inverse of the hypergeometric cumulative distribution function (iCDF).
hygepdf Hypergeometric probability density function (PDF).
hygernd Random arrays from the hypergeometric distribution.
iwishpdf Compute the probability density function of the inverse Wishart distribution.
iwishrnd Return a random matrix sampled from the inverse Wishart distribution with given parameters.
jsucdf Johnson SU cumulative distribution function (CDF).
jsupdf Johnson SU probability density function (PDF).
laplace_cdf Laplace cumulative distribution function (CDF).
laplace_inv Inverse of the Laplace cumulative distribution function (iCDF).
laplace_pdf Laplace probability density function (PDF).
laplace_rnd Random arrays from the Laplace distribution.
logistic_cdf Logistic cumulative distribution function (CDF).
logistic_inv Inverse of the logistic cumulative distribution function (iCDF).
logistic_pdf Logistic probability density function (PDF).
logistic_rnd Random arrays from the logistic distribution.
logncdf Lognormal cumulative distribution function (CDF).
logninv Inverse of the lognormal cumulative distribution function (iCDF).
lognpdf Lognormal probability density function (PDF).
lognrnd Random arrays from the lognormal distribution.
mnpdf Multinomial probability density function (PDF).
mnrnd Random arrays from the multinomial distribution.
mvncdf Multivariate normal cumulative distribution function (CDF).
mvnpdf Multivariate normal probability density function (PDF).
mvnrnd Random vectors from the multivariate normal distribution.
mvtcdf Multivariate Student's t cumulative distribution function (CDF).
mvtpdf Multivariate Student's t probability density function (PDF).
mvtrnd Random vectors from the multivariate Student's t distribution.
mvtcdfqmc Quasi-Monte-Carlo computation of the multivariate Student's T CDF.
nakacdf Nakagami cumulative distribution function (CDF).
nakainv Inverse of the Nakagami cumulative distribution function (iCDF).
nakapdf Nakagami probability density function (PDF).
nakarnd Random arrays from the Nakagami distribution.
nbincdf Negative binomial cumulative distribution function (CDF).
nbininv Inverse of the negative binomial cumulative distribution function (iCDF).
nbinpdf Negative binomial probability density function (PDF).
nbinrnd Random arrays from the negative binomial distribution.
ncfcdf Noncentral F cumulative distribution function (CDF).
ncfinv Inverse of the non-central F cumulative distribution function (iCDF).
ncfpdf Noncentral F probability density function (PDF).
ncfrnd Random arrays from the noncentral F distribution.
nctcdf Noncentral T cumulative distribution function (CDF).
nctinv Inverse of the non-central T cumulative distribution function (iCDF).
nctpdf Noncentral Τ probability density function (pdf).
nctrnd Random arrays from the noncentral T distribution.
ncx2cdf Noncentral Chi-Square cumulative distribution function (CDF).
ncx2inv Inverse of the non-central chi-square cumulative distribution function (iCDF).
ncx2pdf Noncentral Chi-Square probability distribution function (PDF).
ncx2rnd Random arrays from the non-central chi-square distribution.
normcdf Normal cumulative distribution function (CDF).
norminv Inverse of the normal cumulative distribution function (iCDF).
normpdf Normal probability density function (PDF).
normrnd Random arrays from the normal distribution.
poisscdf Poisson cumulative distribution function (CDF).
poissinv Inverse of the Poisson cumulative distribution function (iCDF).
poisspdf Poisson probability density function (PDF).
poissrnd Random arrays from the Poisson distribution.
raylcdf Rayleigh cumulative distribution function (CDF).
raylinv Inverse of the Rayleigh cumulative distribution function (iCDF).
raylpdf Rayleigh probability density function (PDF).
raylrnd Random arrays from the Rayleigh distribution.
stdnormal_cdf Standard normal cumulative distribution function (CDF).
stdnormal_inv Inverse of the standard normal cumulative distribution function (iCDF).
stdnormal_pdf Standard normal probability density function (PDF).
stdnormal_rnd Random arrays from the standard normal distribution.
tcdf Student's T cumulative distribution function (CDF).
tinv Inverse of the Student's T cumulative distribution function (iCDF).
tpdf Student's T probability density function (PDF).
trnd Random arrays from the Student's T distribution.
tricdf Triangular cumulative distribution function (CDF).
triinv Inverse of the triangular cumulative distribution function (iCDF).
tripdf Triangular probability density function (PDF).
trirnd Random arrays from the triangular distribution.
unidcdf Discrete uniform cumulative distribution function (CDF).
unidinv Inverse of the discrete uniform cumulative distribution function (iCDF).
unidpdf Discrete uniform probability density function (PDF).
unidrnd Random arrays from the discrete uniform distribution.
unifcdf Uniform cumulative distribution function (CDF).
unifinv Inverse of the uniform cumulative distribution function (iCDF).
unifpdf Uniform probability density function (PDF).
unifrnd Random arrays from the uniform distribution.
vmcdf Von Mises probability density function (PDF).
vmpdf Von Mises probability density function (PDF).
vmrnd Random arrays from the von Mises distribution.
wblcdf Weibull cumulative distribution function (CDF).
wblinv Inverse of the Weibull cumulative distribution function (iCDF).
wblpdf Weibull probability density function (PDF).
wblrnd Random arrays from the Weibull distribution.
wienrnd Return a simulated realization of the D-dimensional Wiener Process on the interval [0, T].
wishpdf Compute the probability density function of the Wishart distribution
wishrnd Return a random matrix sampled from the Wishart distribution with given parameters

Distribution Fitting

cdfcalc Calculate an empirical cumulative distribution function.
evfit Estimate parameters and confidence intervals for extreme value data.
evlike Negative log-likelihood for the extreme value distribution.
expfit Estimate the mean of the exponential probability distribution function from which sample data S has been taken.
explike Compute the negative log-likelihood of data under the exponential distribution with given parameter value.
gamfit Calculate gamma distribution parameters.
gamlike Calculates the negative log-likelihood function for the Gamma distribution over vector R, with the given parameters A and B in a 2-element vector PARAMS.
gevfit_lmom Find an estimator (PARAMHAT) of the generalized extreme value (GEV) distribution fitting DATA using the method of L-moments.
gevfit Find the maximum likelihood estimator PARAMHAT of the generalized extreme value (GEV) distribution to fit DATA.
gevlike Compute the negative log-likelihood of data under the generalized extreme value (GEV) distribution with given parameter values.
gpfit Parameter estimates and confidence intervals for generalized Pareto data.
gplike Negative log-likelihood for the generalized Pareto distribution.
normlike Negative log-likelihood for the normal distribution.

Distribution Statistics

betastat Compute mean and variance of the beta distribution.
binostat Compute mean and variance of the binomial distribution.
chi2stat Compute mean and variance of the chi-square distribution.
evstat Mean and variance of the extreme value distribution.
expstat Compute mean and variance of the exponential distribution.
fstat Compute mean and variance of the F distribution.
gamstat Compute mean and variance of the gamma distribution.
geostat Compute mean and variance of the geometric distribution.
gevstat Compute the mean and variance of the generalized extreme value distribution.
gpstat Mean and variance of the generalized Pareto distribution.
hygestat Compute mean and variance of the hypergeometric distribution.
lognstat Compute mean and variance of the lognormal distribution.
nbinstat Compute mean and variance of the negative binomial distribution.
ncfstat Mean and variance for the noncentral F distribution.
nctstat Mean and variance for the noncentral T distribution.
ncx2stat Mean and variance for the noncentral chi-square distribution.
normstat Compute mean and variance of the normal distribution.
poisstat Compute mean and variance of the Poisson distribution.
raylstat Compute mean and variance of the Rayleigh distribution.
tstat Compute mean and variance of the t (Student) distribution.
unidstat Compute mean and variance of the discrete uniform distribution.
unifstat Compute mean and variance of the continuous uniform distribution.
wblstat Compute mean and variance of the Weibull distribution.

Experimental Design

fullfact Full factorial design.
ff2n Two-level full factorial design.
sigma_pts Calculates 2*N+1 sigma points in N dimensions.
x2fx Convert predictors to design matrix.

Machine Learning

hmmestimate Estimation of a hidden Markov model for a given sequence.
hmmgenerate Output sequence and hidden states of a hidden Markov model.
hmmviterbi Viterbi path of a hidden Markov model.
svmpredict This function predicts new labels from a testing instance matrtix based on an SVM MODEL created with 'svmtrain'.
svmtrain This function trains an SVM MODEL based on known LABELS and their corresponding DATA which comprise an instance matrtix.

Model Fitting

crossval Perform cross validation on given data.
fitgmdist Fit a Gaussian mixture model with K components to DATA.
fitlm Regress the continuous outcome (i.e. dependent variable) Y on continuous or categorical predictors (i.e. independent variables) X by minimizing the sum-of-squared residuals.

Hypothesis Testing

adtest Anderson-Darling goodness-of-fit hypothesis test.
anova1 Perform a one-way analysis of variance (ANOVA) for comparing the means of two or more groups of data under the null hypothesis that the groups are drawn from distributions with the same mean.
anova2 Performs two-way factorial (crossed) or a nested analysis of variance (ANOVA) for balanced designs.
anovan Perform a multi (N)-way analysis of (co)variance (ANOVA or ANCOVA) to evaluate the effect of one or more categorical or continuous predictors (i.e. independent variables) on a continuous outcome (i.e. dependent variable).
bartlett_test Perform a Bartlett test for the homogeneity of variances.
barttest Bartlett's test of sphericity for correlation.
binotest Test for probability P of a binomial sample
chi2gof Chi-square goodness-of-fit test.
chi2test Perform a chi-squared test (for independence or homogeneity).
correlation_test Perform a correlation coefficient test whether two samples X and Y come from uncorrelated populations.
fishertest Fisher's exact test.
friedman Performs the nonparametric Friedman's test to compare column effects in a two-way layout. friedman tests the null hypothesis that the column effects are all the same against the alternative that they are not all the same.
hotelling_t2test Compute Hotelling's T^2 ("T-squared") test for a single sample or two dependent samples (paired-samples).
hotelling_t2test2 Compute Hotelling's T^2 ("T-squared") test for two independent samples.
kruskalwallis Perform a Kruskal-Wallis test, the non-parametric alternative of a one-way analysis of variance (ANOVA), for comparing the means of two or more groups of data under the null hypothesis that the groups are drawn from the same population, ...
kstest Single sample Kolmogorov-Smirnov (K-S) goodness-of-fit hypothesis test.
kstest2 Two-sample Kolmogorov-Smirnov goodness-of-fit hypothesis test.
levene_test Perform a Levene's test for the homogeneity of variances.
manova1 One-way multivariate analysis of variance (MANOVA).
multcompare Perform posthoc multiple comparison tests or p-value adjustments to control the family-wise error rate (FWER) or false discovery rate (FDR).
ranksum Wilcoxon rank sum test for equal medians.
regression_ftest F-test for General Linear Regression Analysis
regression_ttest Perform a linear regression t-test.
runstest Runs test for detecting serial correlation in the vector X.
sampsizepwr Sample size and power calculation for hypothesis test.
signtest Test for median.
ttest Test for mean of a normal sample with unknown variance.
ttest2 Perform a t-test to compare the means of two groups of data under the null hypothesis that the groups are drawn from distributions with the same mean.
vartest One-sample test of variance.
vartest2 Two-sample F test for equal variances.
vartestn Test for equal variances across multiple groups.
ztest One-sample Z-test.
ztest2 Two proportions Z-test.

I/O

libsvmread This function reads the labels and the corresponding instance_matrix from a LIBSVM data file and stores them in LABELS and DATA respectively.
libsvmwrite This function saves the labels and the corresponding instance_matrix in a file specified by FILENAME.

Plotting

boxplot Produce a box plot.
cdfplot Display an empirical cumulative distribution function.
confusionchart Display a chart of a confusion matrix.
dendrogram Plot a dendrogram of a hierarchical binary cluster tree.
ecdf Empirical (Kaplan-Meier) cumulative distribution function.
gscatter Draw a scatter plot with grouped data.
histfit Plot histogram with superimposed fitted normal density.
hist3 Produce bivariate (2D) histogram counts or plots.
manovacluster Cluster group means using manova1 output.
normplot Produce normal probability plot of the data in X.
ppplot Perform a PP-plot (probability plot).
qqplot Perform a QQ-plot (quantile plot).
silhouette Compute the silhouette values of clustered data and show them on a plot.
violin Produce a Violin plot of the data X.
wblplot Plot a column vector DATA on a Weibull probability plot using rank regression.

Regression

canoncorr Canonical correlation analysis.
cholcov Cholesky-like decomposition for covariance matrix.
dcov Distance correlation, covariance and correlation statistics.
logistic_regression Perform ordinal logistic regression.
monotone_smooth Produce a smooth monotone increasing approximation to a sampled functional dependence.
pca Performs a principal component analysis on a data matrix X.
pcacov Perform principal component analysis on the NxN covariance matrix X.
pcares Calculate residuals from principal component analysis.
plsregress Calculate partial least squares regression using SIMPLS algorithm.
princomp Performs a principal component analysis on a NxP data matrix X.
regress Multiple Linear Regression using Least Squares Fit of Y on X with the model 'y = X * beta + e'.
regress_gp Linear scalar regression using gaussian processes.
stepwisefit Linear regression with stepwise variable selection.

Wrappers

cdf Return the CDF of NAME distribution function for value X.
icdf Return the inverse CDF of NAME distribution function for value P.
pdf Return the PDF of NAME distribution function for value X.
random Random arrays from from a given one-, two-, or three-parameter distribution.