Function Reference

Statistics

Descriptive Statistics

mean
If X is a vector, compute the mean of the elements of X
median
If X is a vector, compute the median value of the elements of X.
quantile
For a sample, X, calculate the quantiles, Q, corresponding to the cumulative probability values in P.
prctile
Computes the value associated with the P-th percentile of X.
meansq
For vector arguments, return the mean square of the values.
std
If X is a vector, compute the standard deviation of the elements of X.
var
For vector arguments, return the (real) variance of the values.
mode
Count the most frequently appearing value.
cov
Compute covariance.
cor
Compute correlation.
corrcoef
Compute correlation.
kurtosis
If X is a vector of length N, return the kurtosis
skewness
If X is a vector of length n, return the skewness
statistics
If X is a matrix, return a matrix with the minimum, first quartile, median, third quartile, maximum, mean, standard deviation, skewness and kurtosis of the columns of X as its rows.
moment
If X is a vector, compute the P-th moment of X.

Basic Statistical Functions

mahalanobis
Return the Mahalanobis' D-square distance between the multivariate samples X and Y, which must have the same number of components (columns), but may have a different number of observations (rows).
center
If X is a vector, subtract its mean.
studentize
If X is a vector, subtract its mean and divide by its standard deviation.
nchoosek
Compute the binomial coefficient or all combinations of N.
perms
Generate all permutations of V, one row per permutation.
values
Return the different values in a column vector, arranged in ascending order.
table
Create a contingency table T from data vectors.
spearman
Compute Spearman's rank correlation coefficient RHO for each of the variables specified by the input arguments.
run_count
Count the upward runs along the first non-singleton dimension of X of length 1, 2, .
ranks
Return the ranks of X along the first non-singleton dimension adjust for ties.
range
If X is a vector, return the range, i.
probit
For each component of P, return the probit (the quantile of the standard normal distribution) of P.
logit
For each component of P, return the logit of P defined as logit(P) = log (P / (1-P))
cloglog
Return the complementary log-log function of X, defined as
kendall
Compute Kendall's TAU for each of the variables specified by the input arguments.
iqr
If X is a vector, return the interquartile range, i.
cut
Create categorical data out of numerical or continuous data by cutting into intervals.

Statistical Plots

qqplot
Perform a QQ-plot (quantile plot).
ppplot
Perform a PP-plot (probability plot).

Tests

anova
Perform a one-way analysis of variance (ANOVA).
bartlett_test
Perform a Bartlett test for the homogeneity of variances in the data vectors X1, X2, .
chisquare_test_homogeneity
Given two samples X and Y, perform a chisquare test for homogeneity of the null hypothesis that X and Y come from the same distribution, based on the partition induced by the (strictly increasing) ent
chisquare_test_independence
Perform a chi-square test for independence based on the contingency table X.
cor_test
Test whether two samples X and Y come from uncorrelated populations.
f_test_regression
Perform an F test for the null hypothesis rr * b = r in a classical normal regression model y = X * b + e.
hotelling_test
For a sample X from a multivariate normal distribution with unknown mean and covariance matrix, test the null hypothesis that `mean (X) == M'.
hotelling_test_2
For two samples X from multivariate normal distributions with the same number of variables (columns), unknown means and unknown equal covariance matrices, test the null hypothesis `mean (X) == mean (Y
kolmogorov_smirnov_test
Perform a Kolmogorov-Smirnov test of the null hypothesis that the sample X comes from the (continuous) distribution dist.
kolmogorov_smirnov_test_2
Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis that the samples X and Y come from the same (continuous) distribution.
kruskal_wallis_test
Perform a Kruskal-Wallis one-factor "analysis of variance".
manova
Perform a one-way multivariate analysis of variance (MANOVA).
mcnemar_test
For a square contingency table X of data cross-classified on the row and column variables, McNemar's test can be used for testing the null hypothesis of symmetry of the classification probabilities.
prop_test_2
If X1 and N1 are the counts of successes and trials in one sample, and X2 and N2 those in a second one, test the null hypothesis that the success probabilities P1 and P2 are the same.
run_test
Perform a chi-square test with 6 degrees of freedom based on the upward runs in the columns of X.
sign_test
For two matched-pair samples X and Y, perform a sign test of the null hypothesis PROB (X > Y) == PROB (X < Y) == 1/2.
t_test
For a sample X from a normal distribution with unknown mean and variance, perform a t-test of the null hypothesis `mean (X) == M'.
t_test_2
For two samples x and y from normal distributions with unknown means and unknown equal variances, perform a two-sample t-test of the null hypothesis of equal means.
t_test_regression
Perform an t test for the null hypothesis `RR * B = R' in a classical normal regression model `Y = X * B + E'.
u_test
For two samples X and Y, perform a Mann-Whitney U-test of the null hypothesis PROB (X > Y) == 1/2 == PROB (X < Y).
var_test
For two samples X and Y from normal distributions with unknown means and unknown variances, perform an F-test of the null hypothesis of equal variances.
welch_test
For two samples X and Y from normal distributions with unknown means and unknown and not necessarily equal variances, perform a Welch test of the null hypothesis of equal means.
wilcoxon_test
For two matched-pair sample vectors X and Y, perform a Wilcoxon signed-rank test of the null hypothesis PROB (X > Y) == 1/2.
z_test
Perform a Z-test of the null hypothesis `mean (X) == M' for a sample X from a normal distribution with unknown mean and known variance V.
z_test_2
For two samples X and Y from normal distributions with unknown means and known variances V_X and V_Y, perform a Z-test of the hypothesis of equal means.

Models

logistic_regression
Perform ordinal logistic regression.

Distributions

betacdf
For each element of X, returns the CDF at X of the beta distribution with parameters A and B, i.
betainv
For each component of X, compute the quantile (the inverse of the CDF) at X of the Beta distribution with parameters A and B.
betapdf
For each element of X, returns the PDF at X of the beta distribution with parameters A and B.
binocdf
For each element of X, compute the CDF at X of the binomial distribution with parameters N and P.
binoinv
For each element of X, compute the quantile at X of the binomial distribution with parameters N and P.
binopdf
For each element of X, compute the probability density function (PDF) at X of the binomial distribution with parameters N and P.
cauchy_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Cauchy distribution with location parameter LAMBDA and scale parameter SIGMA.
cauchy_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Cauchy distribution with location parameter LAMBDA and scale parameter SIGMA.
cauchy_pdf
For each element of X, compute the probability density function (PDF) at X of the Cauchy distribution with location parameter LAMBDA and scale parameter SIGMA > 0.
chi2cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the chisquare distribution with N degrees of freedom.
chi2inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the chisquare distribution with N degrees of freedom.
chi2pdf
For each element of X, compute the probability density function (PDF) at X of the chisquare distribution with N degrees of freedom.
discrete_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of a univariate discrete distribution which assumes the values in V with probabilities P.
discrete_inv
For each component of X, compute the quantile (the inverse of the CDF) at X of the univariate distribution which assumes the values in V with probabilities P.
discrete_pdf
For each element of X, compute the probability density function (PDF) at X of a univariate discrete distribution which assumes the values in V with probabilities P.
empirical_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the empirical distribution obtained from the univariate sample DATA.
empirical_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the empirical distribution obtained from the univariate sample DATA.
empirical_pdf
For each element of X, compute the probability density function (PDF) at X of the empirical distribution obtained from the univariate sample DATA.
expcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the exponential distribution with mean LAMBDA.
expinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the exponential distribution with mean LAMBDA.
exppdf
For each element of X, compute the probability density function (PDF) of the exponential distribution with mean LAMBDA.
fcdf
For each element of X, compute the CDF at X of the F distribution with M and N degrees of freedom, i.
finv
For each component of X, compute the quantile (the inverse of the CDF) at X of the F distribution with parameters M and N.
fpdf
For each element of X, compute the probability density function (PDF) at X of the F distribution with M and N degrees of freedom.
gamcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Gamma distribution with parameters A and B.
gaminv
For each component of X, compute the quantile (the inverse of the CDF) at X of the Gamma distribution with parameters A and B.
gampdf
For each element of X, return the probability density function (PDF) at X of the Gamma distribution with parameters A and B.
geocdf
For each element of X, compute the CDF at X of the geometric distribution with parameter P.
geoinv
For each element of X, compute the quantile at X of the geometric distribution with parameter P.
geopdf
For each element of X, compute the probability density function (PDF) at X of the geometric distribution with parameter P.
hygecdf
Compute the cumulative distribution function (CDF) at X of the hypergeometric distribution with parameters T, M, and N.
hygeinv
For each element of X, compute the quantile at X of the hypergeometric distribution with parameters T, M, and N.
hygepdf
Compute the probability density function (PDF) at X of the hypergeometric distribution with parameters T, M, and N.
kolmogorov_smirnov_cdf
Return the CDF at X of the Kolmogorov-Smirnov distribution, Inf Q(x) = SUM (-1)^k exp(-2 k^2 x^2) k = -Inf
laplace_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Laplace distribution.
laplace_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Laplace distribution.
laplace_pdf
For each element of X, compute the probability density function (PDF) at X of the Laplace distribution.
logistic_cdf
For each component of X, compute the CDF at X of the logistic distribution.
logistic_inv
For each component of X, compute the quantile (the inverse of the CDF) at X of the logistic distribution.
logistic_pdf
For each component of X, compute the PDF at X of the logistic distribution.
logncdf
For each element of X, compute the cumulative distribution function (CDF) at X of the lognormal distribution with parameters MU and SIGMA.
logninv
For each element of X, compute the quantile (the inverse of the CDF) at X of the lognormal distribution with parameters MU and SIGMA.
lognpdf
For each element of X, compute the probability density function (PDF) at X of the lognormal distribution with parameters MU and SIGMA.
nbincdf
For each element of X, compute the CDF at x of the Pascal (negative binomial) distribution with parameters N and P.
nbininv
For each element of X, compute the quantile at X of the Pascal (negative binomial) distribution with parameters N and P.
nbinpdf
For each element of X, compute the probability density function (PDF) at X of the Pascal (negative binomial) distribution with parameters N and P.
normcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the normal distribution with mean M and standard deviation S.
norminv
For each element of X, compute the quantile (the inverse of the CDF) at X of the normal distribution with mean M and standard deviation S.
normpdf
For each element of X, compute the probability density function (PDF) at X of the normal distribution with mean M and standard deviation S.
poisscdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Poisson distribution with parameter lambda.
poissinv
For each component of X, compute the quantile (the inverse of the CDF) at X of the Poisson distribution with parameter LAMBDA.
poisspdf
For each element of X, compute the probability density function (PDF) at X of the poisson distribution with parameter LAMBDA.
tcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the t (Student) distribution with N degrees of freedom, i.
tinv
For each probability value X, compute the the inverse of the cumulative distribution function (CDF) of the t (Student) distribution with degrees of freedom N.
tpdf
For each element of X, compute the probability density function (PDF) at X of the T (Student) distribution with N degrees of freedom.
unidcdf
For each element of X, compute the cumulative distribution function (CDF) at X of a univariate discrete distribution which assumes the values in V with equal probability.
unidinv
For each component of X, compute the quantile (the inverse of the CDF) at X of the univariate discrete distribution which assumes the values in V with equal probability
unidpdf
For each element of X, compute the probability density function (PDF) at X of a univariate discrete distribution which assumes the values in V with equal probability.
unifcdf
Return the CDF at X of the uniform distribution on [A, B], i.
unifinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the uniform distribution on [A, B].
unifpdf
For each element of X, compute the PDF at X of the uniform distribution on [A, B].
wblcdf
Compute the cumulative distribution function (CDF) at X of the Weibull distribution with shape parameter SCALE and scale parameter SHAPE, which is
wblinv
Compute the quantile (the inverse of the CDF) at X of the Weibull distribution with shape parameter SCALE and scale parameter SHAPE.
wblpdf
Compute the probability density function (PDF) at X of the Weibull distribution with shape parameter SCALE and scale parameter SHAPE which is given by

Random Number Generation

betarnd
Return an R by C or `size (SZ)' matrix of random samples from the Beta distribution with parameters A and B.
binornd
Return an R by C or a `size (SZ)' matrix of random samples from the binomial distribution with parameters N and P.
cauchy_rnd
Return an R by C or a `size (SZ)' matrix of random samples from the Cauchy distribution with parameters LAMBDA and SIGMA which must both be scalar or of size R by C.
chi2rnd
Return an R by C or a `size (SZ)' matrix of random samples from the chisquare distribution with N degrees of freedom.
discrete_rnd
Generate a row vector containing a random sample of size N from the univariate distribution which assumes the values in V with probabilities P.
empirical_rnd
Generate a bootstrap sample of size N from the empirical distribution obtained from the univariate sample DATA.
exprnd
Return an R by C matrix of random samples from the exponential distribution with mean LAMBDA, which must be a scalar or of size R by C.
frnd
Return an R by C matrix of random samples from the F distribution with M and N degrees of freedom.
gamrnd
Return an R by C or a `size (SZ)' matrix of random samples from the Gamma distribution with parameters A and B.
geornd
Return an R by C matrix of random samples from the geometric distribution with parameter P, which must be a scalar or of size R by C.
hygernd
Return an R by C matrix of random samples from the hypergeometric distribution with parameters T, M, and N.
laplace_rnd
Return an R by C matrix of random numbers from the Laplace distribution.
logistic_rnd
Return an R by C matrix of random numbers from the logistic distribution.
lognrnd
Return an R by C matrix of random samples from the lognormal distribution with parameters MU and SIGMA.
nbinrnd
Return an R by C matrix of random samples from the Pascal (negative binomial) distribution with parameters N and P.
normrnd
Return an R by C or `size (SZ)' matrix of random samples from the normal distribution with parameters mean M and standard deviation S.
poissrnd
Return an R by C matrix of random samples from the Poisson distribution with parameter LAMBDA, which must be a scalar or of size R by C.
trnd
Return an R by C matrix of random samples from the t (Student) distribution with N degrees of freedom.
unidrnd
Return random values from discrete uniform distribution, with maximum value(s) given by the integer MX, which may be a scalar or multidimensional array.
unifrnd
Return an R by C or a `size (SZ)' matrix of random samples from the uniform distribution on [A, B].
wblrnd
Return an R by C matrix of random samples from the Weibull distribution with parameters SCALE and SHAPE which must be scalar or of size R by C.
wienrnd
Return a simulated realization of the D-dimensional Wiener Process on the interval [0, T].