Editing Statistics package

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
The [https://github.com/gnu-octave/statistics/ statistics package] is part of the [https://gnu-octave.github.io/packages/ Octave Packages]. Since version [https://github.com/gnu-octave/statistics/releases/tag/release-1.5.0 1.5.0], the statistics package requires Octave version 6.1 or higher. From Octave v7.2 or later, you can install the latest statistics package (currently 1.5.3) with the following command:
The [https://github.com/gnu-octave/statistics/ statistics package] is part of the [https://gnu-octave.github.io/packages/ Octave Packages].
 
<code>pkg install -forge statistics</code>
 
The following sections provide an overview of the functions available in the statistics package sorted alphabetically and arranged in groups similarly to the package's INDEX file. the '''TODO''' subsections are only informative of the current development plans for the forthcoming releases and they are not intended for reporting bugs, missing features or incompatibilities. Please report these in the [https://github.com/gnu-octave/statistics statistics repository] at GitHub.
 
== Clustering ==
 
=== Available functions ===
 
The following table lists the available functions for clustering data.
 
{| class="wikitable"
! Function
! Description
|-
| [https://gnu-octave.github.io/statistics/cluster.html cluster]
| Define clusters from an agglomerative hierarchical cluster tree.
|-
| [https://gnu-octave.github.io/statistics/clusterdata.html clusterdata]
| Wrapper function for 'linkage' and 'cluster'.
|-
| [https://gnu-octave.github.io/statistics/cmdscale.html cmdscale]
| Classical multidimensional scaling of a matrix.
|-
| [https://gnu-octave.github.io/statistics/confusionmat.html confusionmat]
| Compute a confusion matrix for classification problems.
|-
| [https://gnu-octave.github.io/statistics/ConfusionMatrixChart.html ConfusionMatrixChart]
| Compute a ConfusionMatrixChart class object.
|-
| [https://gnu-octave.github.io/statistics/cophenet.html cophenet]
| Compute the cophenetic correlation coefficient.
|-
| [https://gnu-octave.github.io/statistics/evalclusters.html evalclusters]
| Create a clustering evaluation object to find the optimal number of clusters.
|-
| [https://gnu-octave.github.io/statistics/inconsistent.html inconsistent]
| Compute the inconsistency coefficient for each link of a hierarchical cluster tree.
|-
| [https://gnu-octave.github.io/statistics/kmeans.html kmeans]
| Perform a K-means clustering of an NxD matrix.
|-
| [https://gnu-octave.github.io/statistics/linkage.html linkage]
| Produce a hierarchical clustering dendrogram.
|-
| [https://gnu-octave.github.io/statistics/mhsample.html mahal]
| Mahalanobis' D-square distance.
|-
| [https://gnu-octave.github.io/statistics/mhsample.html mhsample]
| Draws NSAMPLES samples from a target stationary distribution PDF using Metropolis-Hastings algorithm.
|-
| [https://gnu-octave.github.io/statistics/optimalleaforder.html optimalleaforder]
| Compute the optimal leaf ordering of a hierarchical binary cluster tree.
|-
| [https://gnu-octave.github.io/statistics/pdist.html pdist]
| Return the distance between any two rows in X.
|-
| [https://gnu-octave.github.io/statistics/pdist2.html pdist2]
| Compute pairwise distance between two sets of vectors.
|-
| [https://gnu-octave.github.io/statistics/procrustes.html procrustes]
| Procrustes Analysis.
|-
| [https://gnu-octave.github.io/statistics/slicesample.html slicesample]
| Draws NSAMPLES samples from a target stationary distribution PDF using slice sampling of Radford M. Neal.
|-
| [https://gnu-octave.github.io/statistics/squareform.html squareform]
| Interchange between distance matrix and distance vector formats.
|}
 
=== TODO list ===
 
Missing functions:
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* <code>procrustes</code>
</div>
 
== Data Manipulation ==
 
=== Available functions ===
 
The following table lists the available functions for data manipulation.
 
{| class="wikitable"
! Function
! Description
|-
| [https://gnu-octave.github.io/statistics/combnk.html combnk]
| Return all combinations of K elements in DATA.
|-
| [https://gnu-octave.github.io/statistics/crosstab.html crosstab]
| Create a cross-tabulation (contingency table) T from data vectors.
|-
| [https://gnu-octave.github.io/statistics/datasample.html datasample]
| Randomly sample data.
|-
| [https://gnu-octave.github.io/statistics/fillmissing.html fillmissing]
| Replace missing entries of array A either with values in v or as determined by other specified methods.
|-
| [https://gnu-octave.github.io/statistics/grp2idx.html grp2idx]
| Get index for group variables.
|-
| [https://gnu-octave.github.io/statistics/ismissing.html ismissing]
| Find missing data in a numeric or string array.
|-
| [https://gnu-octave.github.io/statistics/normalise_distribution.html normalise_distribution]
|  Transform a set of data so as to be N(0,1) distributed according to an idea by van Albada and Robinson.
|-
| [https://gnu-octave.github.io/statistics/rmmissing.html rmmissing]
| Remove missing or incomplete data from an array.
|-
| [https://gnu-octave.github.io/statistics/standardizeMissing.html standardizeMissing]
| Replace data values specified by indicator in A by the standard ’missing’ data value for that data type.
|-
| [https://gnu-octave.github.io/statistics/tabulate.html tabulate]
| Compute a frequency table.
|}
 
== Descriptive Statistics ==
 
=== Available functions ===
 
The following table lists the available functions for descriptive statistics.
 
{| class="wikitable"
! Function
! Description
|-
| [https://gnu-octave.github.io/statistics/cl_multinom.html cl_multinom]
| Confidence level of multinomial portions.
|-
| [https://gnu-octave.github.io/statistics/geomean.html geomean]
| Compute the geometric mean.
|-
| [https://gnu-octave.github.io/statistics/grpstats.html grpstats]
| Compute summary statistics by group. Fully MATLAB compatible.
|-
| [https://gnu-octave.github.io/statistics/harmmean.html harmmean]
| Compute the harmonic mean.
|-
| [https://gnu-octave.github.io/statistics/jackknife.html jackknife]
| Compute jackknife estimates of a parameter taking one or more given samples as parameters.
|-
| [https://gnu-octave.github.io/statistics/mean.html mean]
| Compute the mean. Fully MATLAB compatible.
|-
| [https://gnu-octave.github.io/statistics/median.html median]
| Compute the median. Fully MATLAB compatible.
|-
| [https://gnu-octave.github.io/statistics/nanmax.html nanmax]
| Find the maximal element while ignoring NaN values.
|-
| [https://gnu-octave.github.io/statistics/nanmin.html nanmin]
| Find the minimal element while ignoring NaN values.
|-
| [https://gnu-octave.github.io/statistics/nansum.html nansum]
| Compute the sum while ignoring NaN values.
|-
| [https://gnu-octave.github.io/statistics/std.html std]
| Compute the standard deviation. Fully MATLAB compatible.
|-
| [https://gnu-octave.github.io/statistics/trimmean.html trimmean]
| Compute the trimmed mean.
|-
| [https://gnu-octave.github.io/statistics/var.html std]
| Compute the variance. Fully MATLAB compatible.
|}
 
=== In external packages ===
 
<code>bootci</code>, <code>bootstrp</code> are implemented in the [https://gnu-octave.github.io/packages/statistics-resampling statistics-resampling] package.
 
=== Shadowing Octave core functions ===
 
The following functions will shadow the respective core functions until Octave 9.
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* <code>mean</code>
* <code>median</code>
* <code>std</code>
* <code>var</code>
</div>
 
=== TODO list ===
 
Update <code>trimmean</code> function to be fully MATLAB compatible.
 
Re-introduce the <code>nan*</code> functions implemented in C++ with the <code>"all"</code> and <code>"vecdim"</code> options.
 
Re-implement the following functions from core Octave, as shadowing functions with updated functionality regarding the <code>"all"</code>, <code>"omitnan"</code>, and <code>"vecdim"</code> options, with the intend to be included in Octave 9.
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* <code>cov</code>
* <code>mad</code>
* <code>meansq</code>
* <code>mode</code>
* <code>moment</code>
</div>


== Distributions ==
== Distributions ==
=== Available functions ===
The following table lists the '''cdf''', '''icdf''', '''pdf''', and '''random''' functions available in the statistics package. Since version [https://github.com/gnu-octave/statistics/releases/tag/release-1.5.3 1.5.3], all CDFs support the "upper" option for evaluating the complement of the respective CDF.
Note! The '''icdf''' wrapper for the quantile functions is not implemented yet.


{| class="wikitable"
{| class="wikitable"
Line 215: Line 10:
! Random Generator
! Random Generator
|-
|-
| [https://en.wikipedia.org/wiki/Birnbaum%E2%80%93Saunders_distribution Birnbaum–Saunders]
| https://en.wikipedia.org/wiki/Birnbaum%E2%80%93Saunders_distribution | Birnbaum–Saunders Distribution
| bbscdf
| bbscdf
| bbsinv
| bbsinv
Line 221: Line 16:
| bbsrnd
| bbsrnd
|-
|-
| [https://en.wikipedia.org/wiki/Beta_distribution Beta]
| https://en.wikipedia.org/wiki/Beta_distribution | Beta Distribution
| betacdf
| betacdf
| betainv
| betainv
Line 227: Line 22:
| betarndbivariate  
| betarndbivariate  
|-
|-
| [[https://en.wikipedia.org/wiki/Binomial_distribution Binomial]
| https://en.wikipedia.org/wiki/Binomial_distribution | Binomial Distribution
| binocdf
| binocdf
| binoinv
| binoinv
Line 233: Line 28:
| binornd  
| binornd  
|-
|-
| [https://en.wikipedia.org/wiki/Joint_probability_distribution Bivariate Normal]
| Bivariate Distribution
| bvncdf
| bvncdf
|
|
Line 239: Line 34:
|
|
|-
|-
| [https://en.wikipedia.org/wiki/Joint_probability_distribution Bivariate Student's <i>t</i>]
| https://www.mathworks.com/help/stats/burr-type-xii-distribution.html | Burr Type XII Distribution
| bvtcdf
|
|
|
|-
| [https://www.mathworks.com/help/stats/burr-type-xii-distribution.html Burr Type XII]
| burrcdf
| burrcdf
| burrinv
| burrinv
Line 251: Line 40:
| burrrnd
| burrrnd
|-
|-
| [https://en.wikipedia.org/wiki/Cauchy_distribution Cauchy]
| https://en.wikipedia.org/wiki/Cauchy_distribution | Cauchy distribution Distribution
| cauchy_cdf
| cauchy_cdf
| cauchy_inv
| cauchy_inv
Line 257: Line 46:
| cauchy_rnd
| cauchy_rnd
|-
|-
| [https://en.wikipedia.org/wiki/Chi-squared_distribution Chi-squared]
| https://en.wikipedia.org/wiki/Chi-squared_distribution | Chi-squared Distribution
| chi2cdf
| chi2cdf
| chi2inv
| chi2inv
Line 263: Line 52:
| chi2rnd
| chi2rnd
|-
|-
| [https://en.wikipedia.org/wiki/Copula_(probability_theory) Copula Family]
| Copula Family Distributions
| copulacdf
| copulacdf
| copulainv
| copulainv
Line 269: Line 58:
| copularnd
| copularnd
|-
|-
| [https://en.wikipedia.org/wiki/Gumbel_distribution Extreme Value]
| Extreme Value Distribution
| evcdf
| evcdf
| evinv
| evinv
Line 275: Line 64:
| evrnd
| evrnd
|-
|-
| [https://en.wikipedia.org/wiki/Exponential_distribution Exponential]
| https://en.wikipedia.org/wiki/Exponential_distribution | Exponential Distribution
| expcdf
| expcdf
| expinv
| expinv
Line 281: Line 70:
| exprnd
| exprnd
|-
|-
| [https://en.wikipedia.org/wiki/F-distribution F]
| https://en.wikipedia.org/wiki/F-distribution | F-Distribution
| fcdf
| fcdf
| finv
| finv
Line 287: Line 76:
| frnd
| frnd
|-
|-
| [https://en.wikipedia.org/wiki/Gamma_distribution Gamma]
| https://en.wikipedia.org/wiki/Gamma_distribution | Gamma Distribution
| gamcdf
| gamcdf
| gaminv
| gaminv
Line 293: Line 82:
| gamrnd
| gamrnd
|-
|-
| [https://en.wikipedia.org/wiki/Geometric_distribution Geometric]
| https://en.wikipedia.org/wiki/Geometric_distribution | Geometric Distribution
| geocdf
| geocdf
| geoinv
| geoinv
Line 299: Line 88:
| geornd
| geornd
|-
|-
| [https://en.wikipedia.org/wiki/Generalized_extreme_value_distribution Generalized Extreme Value]
| https://en.wikipedia.org/wiki/Generalized_extreme_value_distribution | Generalized Extreme Value Distribution
| gevcdf
| gevcdf
| gevinv
| gevinv
Line 305: Line 94:
| gevrnd
| gevrnd
|-
|-
| [https://en.wikipedia.org/wiki/Generalized_Pareto_distribution Generalized Pareto]
| https://en.wikipedia.org/wiki/Generalized_Pareto_distribution | Generalized Pareto Distribution
| gpcdf
| gpcdf
| gpinv
| gpinv
Line 311: Line 100:
| gprnd
| gprnd
|-
|-
| [https://en.wikipedia.org/wiki/Hypergeometric_distribution Hypergeometric]
| https://en.wikipedia.org/wiki/Hypergeometric_distribution | Hypergeometric Pareto Distribution
| hygecdf
| hygecdf
| hygeinv
| hygeinv
Line 317: Line 106:
| hygernd
| hygernd
|-
|-
| [https://en.wikipedia.org/wiki/Inverse-Wishart_distribution Inverse-Wishart]
| https://en.wikipedia.org/wiki/Inverse-Wishart_distribution | Inverse-Wishart Distribution
|
|
|
|
Line 323: Line 112:
| iwishrnd
| iwishrnd
|-
|-
| [https://en.wikipedia.org/wiki/Johnson%27s_SU-distribution Johnson's SU]
| https://en.wikipedia.org/wiki/Johnson%27s_SU-distribution | Johnson's SU Distribution
| jsucdf
| jsucdf
|
|
Line 329: Line 118:
|
|
|-
|-
| [https://en.wikipedia.org/wiki/Laplace_distribution Laplace]
| https://en.wikipedia.org/wiki/Laplace_distribution | Laplace Distribution
| laplace_cdf
| laplace_cdf
| laplace_inv
| laplace_inv
Line 335: Line 124:
| laplace_rnd
| laplace_rnd
|-
|-
| [https://en.wikipedia.org/wiki/Logistic_distribution Logistic]
| https://en.wikipedia.org/wiki/Logistic_distribution | Logistic Distribution
| logistic_cdf
| logistic_cdf
| logistic_inv
| logistic_inv
Line 341: Line 130:
| logistic_rnd
| logistic_rnd
|-
|-
| [https://en.wikipedia.org/wiki/Log-normal_distribution Log-normal]
| https://en.wikipedia.org/wiki/Log-normal_distribution | Log-normal Distribution
| logncdf
| logncdf
| logninv
| logninv
Line 347: Line 136:
| lognrnd
| lognrnd
|-
|-
| [https://en.wikipedia.org/wiki/Multinomial_distribution Multinomial]
| https://en.wikipedia.org/wiki/Multinomial_distribution | Multinomial Distribution
|
|
|
|
Line 353: Line 142:
| mnrnd
| mnrnd
|-
|-
| [https://en.wikipedia.org/wiki/Multivariate_normal_distribution Multivariate Normal]
| https://en.wikipedia.org/wiki/Multivariate_normal_distribution | Multivariate Normal Distribution
| mvncdf
| mvncdf
| mvninv
| mvninv
Line 359: Line 148:
| mvnrnd
| mvnrnd
|-
|-
| [https://en.wikipedia.org/wiki/Multivariate_t-distribution Multivariate Student's <i>t</i>]
| https://en.wikipedia.org/wiki/Multivariate_t-distribution | Multivariate T-Distribution
| mvtcdf mvtcdfqmc
| mvtcdf mvtcdfqmc
| mvtinv
| mvtinv
Line 365: Line 154:
| mvtrnd
| mvtrnd
|-
|-
| [https://en.wikipedia.org/wiki/Nakagami_distribution Nakagami]
| https://en.wikipedia.org/wiki/Nakagami_distribution | Nakagami Distribution
| nakacdf
| nakacdf
| nakainv
| nakainv
Line 371: Line 160:
| nakarnd
| nakarnd
|-
|-
| [https://en.wikipedia.org/wiki/Negative_binomial_distribution Negative Binomial]
| https://en.wikipedia.org/wiki/Negative_binomial_distribution | Negative Binomial Distribution
| nbincdf
| nbincdf
| nbininv
| nbininv
Line 377: Line 166:
| nbinrnd
| nbinrnd
|-
|-
| [https://en.wikipedia.org/wiki/Noncentral_F-distribution Noncentral F]
| https://en.wikipedia.org/wiki/Noncentral_F-distribution | Noncentral F-Distribution
| ncfcdf
| ncfcdf
| ncfinv
| ncfinv
Line 383: Line 172:
| ncfrnd
| ncfrnd
|-
|-
| [https://en.wikipedia.org/wiki/Noncentral_t-distribution Noncentral Student's <i>t</i>]
| https://en.wikipedia.org/wiki/Noncentral_t-distribution | Noncentral T-Distribution
| nctcdf
| ncfcdf
| nctinv
| ncfinv
| nctpdf
| ncfpdf
| nctrnd
| ncfrnd
|-
|-
| [https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution Noncentral Chi-squared]
| https://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution | Noncentral chi-squared Distribution
| ncx2cdf
| ncx2cdf
| ncx2inv
| ncx2inv
| ncx2pdf
| ncx2pdf
| ncx2rnd
| ncx2rnd
|-
| [https://en.wikipedia.org/wiki/Normal_distribution Normal]
| normcdf
| norminv
| normpdf
| normrnd
|-
| [https://en.wikipedia.org/wiki/Poisson_distribution Poisson]
| poisscdf
| poissinv
| poisspdf
| poissrnd
|-
| [https://en.wikipedia.org/wiki/Rayleigh_distribution Rayleigh]
| raylcdf
| raylinv
| raylpdf
| raylrnd
|-
| [https://en.wikipedia.org/wiki/Normal_distribution#Standard_normal_distribution Standard Normal]
| stdnormal_cdf
| stdnormal_inv
| stdnormal_pdf
| stdnormal_rnd
|-
| [https://en.wikipedia.org/wiki/Student%27s_t-distribution Student's <i>t</i>]
| tcdf
| tinv
| tpdf
| trnd
|-
| [https://en.wikipedia.org/wiki/Triangular_distribution Triangular]
| tricdf
| triinv
| tripdf
| trirnd
|-
| [https://en.wikipedia.org/wiki/Discrete_uniform_distribution Discrete Uniform]
| unidcdf
| unidinv
| unidpdf
| unidrnd
|-
| [https://en.wikipedia.org/wiki/Continuous_uniform_distribution Continuous Uniform]
| unifcdf
| unifinv
| unifpdf
| unifrnd
|-
| [https://en.wikipedia.org/wiki/Von_Mises_distribution von Mises]
| vmcdf
|
| vmpdf
| vmrnd
|-
| [https://en.wikipedia.org/wiki/Weibull_distribution Weibull]
| wblcdf
| wblinv
| wblpdf
| wblrnd
|-
| [https://en.wikipedia.org/wiki/Wiener_process Wiener process]
|
|
|
| wienrnd
|-
| [https://en.wikipedia.org/wiki/Wishart_distribution Wishart]
|
|
| wishpdf
| wishrnd
|}
=== Distribution Fitting ===
Functions available for estimating parameters and the negative log-likelihood for certain distributions.
{| class="wikitable"
! Distribution Name
! Parameter Estimation
! Negativel Log-likelihood
|-
| Extreme Value
| evfit
| evlike
|-
| Exponential
| expfit
| explike
|-
| Gamma
| gamfit
| gamlike
|-
| Generalized Extreme Value
| gevfit_lmom gevfit
| gevlike
|-
| Generalized Pareto
| gpfit
| gplike
|-
| Normal
|
| normlike
|}
|}


=== Distribution Statistics ===
=== Matlab incompatible ===
 
Functions available for computing ''mean'' and ''variance'' from distribution parameters.
 
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
* <code>betastat</code>
* <code>binostat</code>
* <code>chi2stat</code>
* <code>evstat</code>
* <code>expstat</code>
* <code>fstat</code>
* <code>gamstat</code>
* <code>geostat</code>
* <code>gevstat</code>
* <code>gpstat</code>
* <code>hygestat</code>
* <code>lognstat</code>
* <code>nbinstat</code>
* <code>ncfstat</code>
* <code>nctstat</code>
* <code>ncx2stat</code>
* <code>normstat</code>
* <code>poisstat</code>
* <code>raylstat</code>
* <code>fitgmdist</code>
* <code>tstat</code>
* <code>unidstat</code>
* <code>unifstat</code>
* <code>wblstat</code>
</div>


== Experimental Design ==
These functions have the same name as Matlab functions but have a different interface


=== Available functions ===
* boxplot
* gpcdf
* gpinv
* gppdf
* gprnd


Functions available for computing design matrices.
=== Can be reused in other functions ===


{| class="wikitable"
{| class="wikitable"
! Function
!forge function
! Description
!matlab counterpart
|-
|-
| [https://gnu-octave.github.io/statistics/fullfact.html fullfact]
|anderson_darling_test
| Full factorial design.
|adtest
|-
|-
| [https://gnu-octave.github.io/statistics/ff2n.html ff2n]
|bbscdf
| Two-level full factorial design.
|BirnbaumSaundersDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/sigma_pts.html sigma_pts]
|bbsinv
| Calculates 2*N+1 sigma points in N dimensions.
|BirnbaumSaundersDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/x2fx.html x2fx]
|bbspdf
| Convert predictors to design matrix.
|BirnbaumSaundersDistribution class
|}
 
== Machine Learning ==
 
=== Available functions ===
 
The following table lists the available functions.
 
{| class="wikitable"
! Function
! Description
|-
|-
| [https://gnu-octave.github.io/statistics/hmmestimate.html hmmestimate]
|bbsrnd
| Estimation of a hidden Markov model for a given sequence.
|BirnbaumSaundersDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/hmmgenerate.html hmmgenerate]
|binotest
| Output sequence and hidden states of a hidden Markov model.
|binofit
|-
|-
| [https://gnu-octave.github.io/statistics/hmmviterbi.html hmmviterbi]
|burrcdf
| Viterbi path of a hidden Markov model.
|BurrDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/svmpredict.html svmpredict]
|burrinv
| Perform a K-means clustering of an NxD matrix.
|BurrDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/svmtrain.html svmtrain]
|burrpdf
| Produce a hierarchical clustering dendrogram.
|BurrDistribution class
|}
 
=== TODO list ===
 
Update <code>svmpredict</code> and <code>svmtrain</code> to libsvm 3.0.
 
Missing functions:
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* <code>hmmdecode</code>
* <code>hmmtrain</code>
</div>
 
== Model Fitting ==
 
=== Available functions ===
 
Functions available for fitting or evaluating statistical models.
 
{| class="wikitable"
! Function
! Description
|-
|-
| [https://gnu-octave.github.io/statistics/crossval.html crossval]
|burrrnd
| Perform cross validation on given data.
|BurrDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/fitgmdist.html fitgmdist]
|nakacdf
| Fit a Gaussian mixture model with K components to DATA.
|NakagamiDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/fitlm.html fitlm]
|nakainv
| 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.
|NakagamiDistribution class
|}
 
=== Cross Validation ===
 
Class of set partitions for cross-validation, used in crossval
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* @cvpartition/cvpartition
* @cvpartition/display
* @cvpartition/get
* @cvpartition/repartition
* @cvpartition/set
* @cvpartition/test
* @cvpartition/training
</div>
 
=== TODO list ===
 
Missing functions:
 
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* <code>anova</code>
* <code>manova</code>
</div>
 
== Hypothesis Testing ==
 
=== Available functions ===
 
Functions available for hypothesis testing
 
{| class="wikitable"
! Function
! Description
|-
|-
| [https://gnu-octave.github.io/statistics/adtest.html adtest]
|nakapdf
| Anderson-Darling goodness-of-fit hypothesis test.
|NakagamiDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/anova1.html anova1]
|nakarnd - should be used to implement the
| Perform a one-way analysis of variance (ANOVA)
|NakagamiDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/anova2.html anova2]
|regress_gp
| Performs two-way factorial (crossed) or a nested analysis of variance (ANOVA) for balanced designs.
|RegressionGP class
|-
|-
| [https://gnu-octave.github.io/statistics/anovan.html anovan]
|repanova
| 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).
|RepeatedMeasuresModel.ranova
|-
|-
| [https://gnu-octave.github.io/statistics/bartlett_test.html bartlett_test]
|tricdf
| Perform a Bartlett test for the homogeneity of variances.
|TriangularDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/barttest.html barttest]
|triinv
| Bartlett's test of sphericity for correlation.
|TriangularDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/binotest.html binotest]
|tripdf
| Test for probability P of a binomial sample
|TriangularDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/chi2gof.html chi2gof]
|trirnd
| Chi-square goodness-of-fit test.
|TriangularDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/chi2test.html chi2test]
|logistic_cdf
| Perform a chi-squared test (for independence or homogeneity).
|LogisticDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/correlation_test.html correlation_test]
|logistic_inv
| Perform a correlation coefficient test whether two samples x and y come from uncorrelated populations.
|LogisticDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/fishertest.html fishertest]
|logistic_pdf
| Fisher’s exact test.
|LogisticDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/friedman.html friedman]
|logistic_rnd
| Performs the nonparametric Friedman's test to compare column effects in a two-way layout.
|LogisticDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/hotelling_t2test.html hotelling_t2test]
|stdnormal_cdf
| Compute Hotelling's T^2 ("T-squared") test for a single sample or two dependent samples (paired-samples).
|NormalDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/hotelling_t2test2.html hotelling_t2test2]
|stdnormal_inv
| Compute Hotelling's T^2 ("T-squared") test for two independent samples.
|NormalDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/kruskalwallis.html kruskalwallis]
|stdnormal_pdf
| Perform a Kruskal-Wallis test, the non-parametric alternative of a one-way analysis of variance (ANOVA).
|NormalDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/kstest.html kstest]
|stdnormal_rnd
| Single sample Kolmogorov-Smirnov (K-S) goodness-of-fit hypothesis test.
|NormalDistribution class
|-
|-
| [https://gnu-octave.github.io/statistics/kstest2.html kstest2]
|anova
| Two-sample Kolmogorov-Smirnov goodness-of-fit hypothesis test.
|anova method in different *Model classes
|-
|-
| [https://gnu-octave.github.io/statistics/levene_test.html levene_test]
|manova
| Perform a Levene's test for the homogeneity of variances.
|manova methods in different *Model classes
|-
|-
| [https://gnu-octave.github.io/statistics/manova1.html manova1]
|bartlett_test
| One-way multivariate analysis of variance (MANOVA).
|barttest
|-
|-
| [https://gnu-octave.github.io/statistics/multcompare.html multcompare]
|kolmogorov_smirnov_test
| Perform posthoc multiple comparison tests or p-value adjustments to control the family-wise error rate (FWER) or false discovery rate (FDR).
|ktest
|-
|-
| [https://gnu-octave.github.io/statistics/ranksum.html ranksum]
|kolmogorov_smirnov_test_2
| Wilcoxon rank sum test for equal medians.  This test is equivalent to a Mann-Whitney U-test.
|ktest2
|-
|-
| [https://gnu-octave.github.io/statistics/regression_ftest.html regression_ftest]
|kruskal_wallis_test
| F-test for General Linear Regression Analysis
|kruskalwallis
|-
| [https://gnu-octave.github.io/statistics/regression_ttest.html regression_ttest]
| Perform a linear regression t-test.
|-
| [https://gnu-octave.github.io/statistics/runstest.html runstest]
| Runs test for detecting serial correlation in the vector X.
|-
| [https://gnu-octave.github.io/statistics/sampsizepwr.html sampsizepwr]
| Sample size and power calculation for hypothesis test.
|-
| [https://gnu-octave.github.io/statistics/signtest.html signtest]
| Test for median.
|-
| [https://gnu-octave.github.io/statistics/ttest.html ttest]
| Test for mean of a normal sample with unknown variance or a paired-sample t-test.
|-
| [https://gnu-octave.github.io/statistics/ttest2.html ttest2]
| Perform a two independent samples t-test.
|-
| [https://gnu-octave.github.io/statistics/vartest.html vartest]
| One-sample test of variance.
|-
| [https://gnu-octave.github.io/statistics/vartest2.html vartest2]
| Two-sample F test for equal variances.
|-
| [https://gnu-octave.github.io/statistics/vartestn.html vartestn]
| Test for equal variances across multiple groups.
|-
| [https://gnu-octave.github.io/statistics/ztest.html ztest]
| One-sample Z-test.
|-
| [https://gnu-octave.github.io/statistics/ztest2.html ztest2]
| Two proportions Z-test.
|}
|}


=== TODO list ===
=== Ready to go ===


Missing functions:
These functions seem to be Matlab compatible


<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
* <code>fishertest</code>
* anovan
* <code>meanEffectSize</code>
* betastat
* binostat
* binotest
* canoncorr
* caseread
* casewrite
* cdf
* chi2stat
* cmdscale
* combnk
* copulacdf
* copulapdf
* copularnd
* crossval
* @cvpartition
* dendrogram
* expstat
* ff2n
* fitgmdist
* fstat
* fullfact
* gamfit
* gamlike
* gamstat
* geomean
* geostat
* gevcdf
* gevfit
* gevinv
* gevlike
* gevpdf
* gevrnd
* gevstat
* gmdistribution
* grp2idx
* harmmean
* hist3
* histfit
* hmmestimate
* hmmgenerate
* hmmviterbi
* hygestat
* iwishrnd
* jackknife
* kmeans
* linkage
* lognstat
* mad
* mahal
* mnpdf
* mnrnd
* mvncdf
* mvnpdf
* mvnrnd
* mvtcdf
* mvtpdf
* mvtrnd
* nanmax
* nanmean
* nanmedian
* nanmin
* nanstd
* nansum
* nanvar
* nbinstat
* normplot
* normstat
* pcacov
* pcares
* pdf
* pdist2
* pdist
* plsregress
* poisstat
* random
* randsample
* raylcdf
* raylinv
* raylpdf
* raylrnd
* raylstat
* regress
* signtest
* squareform
* stepwisefit
* tabulate
* tblread
* tblwrite
* trimmean
* tstat
* ttest2
* ttest
* unidstat
* unifstat
* vartest2
* vartest
* wblstat
* wishrnd
* ztest
* prctile
* qqplot
* betacdf
* betainv
* betapdf
* betarnd
* binocdf
* binoinv
* binopdf
* binornd
* chi2cdf
* chi2inv
* chi2pdf
* chi2rnd
* expcdf
* expinv
* exppdf
* exprnd
* fcdf
* finv
* fpdf
* frnd
* gamcdf
* gaminv
* gampdf
* gamrnd
* geocdf
* geoinv
* geopdf
* geornd
* hygecdf
* hygeinv
* hygepdf
* hygernd
* logncdf
* logninv
* lognpdf
* lognrnd
* nbincdf
* nbininv
* nbinpdf
* nbinrnd
* normcdf
* norminv
* normpdf
* normrnd
* poisscdf
* poissinv
* poisspdf
* poissrnd
* tcdf
* tinv
* tpdf
* trnd
* unidcdf
* unidinv
* unidpdf
* unidrnd
* unifcdf
* unifinv
* unifpdf
* unifrnd
* wblcdf
* wblinv
* wblpdf
* wblrnd
</div>
</div>


== Plotting ==
=== In external packages ===


=== Available functions ===
bootci, bootstrp are implemented in the [https://gnu-octave.github.io/packages/statistics-bootstrap statistics-bootstrap] package


The following table lists the available functions for plotting data.
== Development ==


{| class="wikitable"
Follows an incomplete list of stuff missing in the statistics package to be matlab compatible. Bugs are not listed here, [https://savannah.gnu.org/bugs/?func=search&group=octave search] and [https://savannah.gnu.org/bugs/?func=additem&group=octave report] them on the bug tracker instead.
! Function
! Description
|-
| [https://gnu-octave.github.io/statistics/boxplot.html boxplot]
| Produce a box plot.
|-
| [https://gnu-octave.github.io/statistics/cdfplot.html cdfplot]
| Display an empirical cumulative distribution function.
|-
| [https://gnu-octave.github.io/statistics/confusionchart.html confusionchart]
| Display a chart of a confusion matrix.
|-
| [https://gnu-octave.github.io/statistics/dendrogram.html dendrogram]
| Plot a dendrogram of a hierarchical binary cluster tree.
|-
| [https://gnu-octave.github.io/statistics/ecdf.html ecdf]
| Empirical (Kaplan-Meier) cumulative distribution function.
|-
| [https://gnu-octave.github.io/statistics/gscatter.html gscatter]
| Draw a scatter plot with grouped data.
|-
| [https://gnu-octave.github.io/statistics/histfit.html histfit]
| Plot histogram with superimposed fitted normal density.
|-
| [https://gnu-octave.github.io/statistics/hist3.html hist3]
| Produce bivariate (2D) histogram counts or plots.
|-
| [https://gnu-octave.github.io/statistics/manovacluster.html manovacluster]
| Cluster group means using manova1 output.
|-
| [https://gnu-octave.github.io/statistics/normplot.html normplot]
| Produce normal probability plot of the data.
|-
| [https://gnu-octave.github.io/statistics/ppplot.html ppplot]
| Perform a PP-plot (probability plot).
|-
| [https://gnu-octave.github.io/statistics/qqplot.html qqplot]
| Perform a QQ-plot (quantile plot).
|-
| [https://gnu-octave.github.io/statistics/silhouette.html silhouette]
| Compute the silhouette values of clustered data and show them on a plot.
|-
| [https://gnu-octave.github.io/statistics/violin.html violin]
| Produce a Violin plot of the data.
|-
| [https://gnu-octave.github.io/statistics/wblplot.html wblplot]
| Plot a column vector DATA on a Weibull probability plot using rank regression.
|}


=== TODO list ===
{{Note|this entire section is about the current development version. If a Matlab function is missing from the list and does not appear on the current release of the package, confirm that is also missing in the [https://sourceforge.net/p/octave/statistics/ development sources] before adding it.}}


Missing functions:
=== Missing functions ===
 
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* ClassificationBaggedEnsemble
* <code>andrewsplot</code>
* ClassificationDiscriminant
* <code>bar3</code>
* ClassificationDiscriminant.fit
* <code>bar3h</code>
* ClassificationEnsemble
* <code>glyphplot</code>
* ClassificationKNN
* <code>gplotmatrix</code>
* ClassificationKNN.fit
* <code>parallelcoords</code>
* ClassificationPartitionedEnsemble
</div>
* ClassificationPartitionedModel
 
* ClassificationTree
== Regression ==
* ClassificationTree.fit
 
* CompactClassificationDiscriminant
=== Available functions ===
* CompactClassificationEnsemble
 
* CompactClassificationTree
The following table lists the available functions for regression analysis.
* CompactRegressionEnsemble
 
* CompactRegressionTree
{| class="wikitable"
* CompactTreeBagger
! Function
* ExhaustiveSearcher
! Description
* GeneralizedLinearModel
|-
* GeneralizedLinearModel.fit
| [https://gnu-octave.github.io/statistics/canoncorr.html canoncorr]
* GeneralizedLinearModel.stepwise
| Canonical correlation analysis.
* KDTreeSearcher
|-
* LinearMixedModel
| [https://gnu-octave.github.io/statistics/cholcov.html cholcov]
* LinearMixedModel.fit
| Cholesky-like decomposition for covariance matrix.
* LinearMixedModel.fitmatrix
|-
* LinearModel
| [https://gnu-octave.github.io/statistics/dcov.html dcov]
* LinearModel.fit
| Distance correlation, covariance and correlation statistics.
* LinearModel.stepwise
|-
* NaiveBayes
| [https://gnu-octave.github.io/statistics/logistic_regression.html logistic_regression]
* NaiveBayes.fit
| Perform ordinal logistic regression.
* NonLinearModel
|-
* NonLinearModel.fit
| [https://gnu-octave.github.io/statistics/monotone_smooth.html monotone_smooth]
* ProbDistUnivKernel
| Produce a smooth monotone increasing approximation to a sampled functional dependence.
* ProbDistUnivParam
|-
* RegressionBaggedEnsemble
| [https://gnu-octave.github.io/statistics/pca.html pca]
* RegressionEnsemble
| Performs a principal component analysis on a data matrix.
* RegressionPartitionedEnsemble
|-
* RegressionPartitionedModel
| [https://gnu-octave.github.io/statistics/pcacov.html pcacov]
* RegressionTree
| Perform principal component analysis on the NxN covariance matrix X
* RegressionTree.fit
|-
* TreeBagger
| [https://gnu-octave.github.io/statistics/pcares.html pcares]
* addTerms
| Calculate residuals from principal component analysis.
* addedvarplot
|-
* addlevels
| [https://gnu-octave.github.io/statistics/plsregress.html plsregress]
* adtest
| Calculate partial least squares regression using SIMPLS algorithm.
* andrewsplot
|-
* anova2
| [https://gnu-octave.github.io/statistics/princomp.html princomp]
* ansaribradley
| Performs a principal component analysis on a NxP data matrix.
* aoctool
|-
* barttest
| [https://gnu-octave.github.io/statistics/regress.html regress]
* bbdesign
| Multiple Linear Regression using Least Squares Fit.
* betafit
|-
* betalike
| [https://gnu-octave.github.io/statistics/regress_gp.html regress_gp]
* binofit
| Linear scalar regression using gaussian processes.
* biplot
|-
* candexch
| [https://gnu-octave.github.io/statistics/stepwisefit.html stepwisefit]
* candgen
| Linear regression with stepwise variable selection.
* capability
|}
* capaplot
 
* ccdesign
=== TODO list ===
* cdfplot
 
* cell2dataset
Missing functions:
* chi2gof
 
* cholcov
<div style="column-count:1;-moz-column-count:1;-webkit-column-count:1">
* classify
* <code>glmfit</code>
* classregtree
* <code>glmval</code>
* clustering.evaluation.CalinskiHarabaszEvaluation
* <code>mnrfit</code>
* clustering.evaluation.DaviesBouldinEvaluation
* <code>mnrval</code>
* clustering.evaluation.GapEvaluation
* clustering.evaluation.SilhouetteEvaluation
* coefCI
* coefTest
* compact
* compare
* controlrules
* copulafit
* copulaparam
* copulastat
* cordexch
* corrcov
* covarianceParameters
* coxphfit
* createns
* crosstab
* dataset
* dataset2cell
* dataset2struct
* dataset2table
* datasetfun
* daugment
* dcovary
* designMatrix
* devianceTest
* dfittool
* disttool
* droplevels
* dummyvar
* dwtest
* ecdf
* ecdfhist
* evcdf
* evfit
* evinv
* evlike
* evpdf
* evrnd
* evstat
* export
* factoran
* fitdist
* fitensemble
* fitglm
* fitlm
* fitlme
* fitlmematrix
* fitnlm
* fitted
* fixedEffects
* fracfact
* fracfactgen
* friedman
* fsurfht
* gagerr
* getlabels
* getlevels
* gline
* glmfit
* glmval
* glyphplot
* gname
* gpcdf
* gpfit
* gpinv
* gplike
* gplotmatrix
* gppdf
* gprnd
* gpstat
* grpstats
* haltonset
* hmmdecode
* hmmtrain
* hougen
* icdf
* interactionplot
* invpred
* islevel
* isundefined
* jbtest
* johnsrnd
* join
* knnsearch
* ksdensity
* kstest
* kstest2
* labels
* lasso
* lassoPlot
* lassoglm
* levelcounts
* leverage
* lhsdesign
* lhsnorm
* lillietest
* linhyptest
* lognfit
* lognlike
* lsline
* mahal
* maineffectsplot
* makedist
* manova1
* manovacluster
* mat2dataset
* mdscale
* mergelevels
* mle
* mlecov
* mnrfit
* mnrval
* multcompare
* multivarichart
* mvregress
* mvregresslike
* nancov
* nbinfit
* ncfcdf
* ncfinv
* ncfpdf
* ncfrnd
* ncfstat
* nctcdf
* nctinv
* nctpdf
* nctrnd
* nctstat
* ncx2cdf
* ncx2inv
* ncx2rnd
* ncx2stat
* negloglik
* nlinfit
* nlintool
* nlmefit
* nlmefitsa
* nlparci
* nlpredci
* nnmf
* nominal
* normfit
* normlike
* normspec
* ordinal
* parallelcoords
* paramci
* paretotails
* partialcorr
* partialcorri
* pdf
* pearsrnd
* perfcurve
* plotAdded
* plotAdjustedResponse
* plotDiagnostics
* plotEffects
* plotInteraction
* plotResiduals
* plotSlice
* poissfit
* polytool
* ppca
* predict
* prob.BetaDistribution
* prob.BinomialDistribution
* prob.BirnbaumSaundersDistribution
* prob.BurrDistribution
* prob.ExponentialDistribution
* prob.ExtremeValueDistribution
* prob.GammaDistribution
* prob.GeneralizedExtremeValueDistribution
* prob.GeneralizedParetoDistribution
* prob.InverseGaussianDistribution
* prob.KernelDistribution
* prob.LogisticDistribution
* prob.LoglogisticDistribution
* prob.LognormalDistribution
* prob.MultinomialDistribution
* prob.NakagamiDistribution
* prob.NegativeBinomialDistribution
* prob.NormalDistribution
* prob.PiecewiseLinearDistribution
* prob.PoissonDistribution
* prob.RayleighDistribution
* prob.RicianDistribution
* prob.TriangularDistribution
* prob.UniformDistribution
* prob.WeibullDistribution
* prob.tLocationScaleDistribution
* probplot
* procrustes
* proflik
* qrandset
* qrandstream
* randomEffects
* randtool
* rangesearch
* ranksum
* raylfit
* rcoplot
* refcurve
* refline
* regstats
* relieff
* removeTerms
* residuals
* response
* ridge
* robustdemo
* robustfit
* rotatefactors
* rowexch
* rsmdemo
* rstool
* sampsizepwr
* scatterhist
* sequentialfs
* setlabels
* signrank
* sobolset
* statget
* statset
* step
* stepwise
* stepwiseglm
* stepwiselm
* struct2dataset
* surfht
* svmclassify
* svmtrain
* table2dataset
* tabulate
* tdfread
* tiedrank
* truncate
* unifit
* vartestn
* wblfit
* wbllike
* x2fx
* xptread
</div>
</div>


== Wrappers ==
=== Missing options ===


=== Available functions ===
*explike: censoring and frequency aren't yet implemented
 
Functions available for wrapping other functions or group of functions.
 
{| class="wikitable"
! Function
! Description
|-
| [https://gnu-octave.github.io/statistics/cdf.html cdf]
| This is a wrapper for the NAMEcdf and NAME_cdf functions available in the statistics package.
|-
| [https://gnu-octave.github.io/statistics/icdf.html icdf]
| This is a wrapper for the NAMEinv and NAME_inv functions available in the statistics package.
|-
| [https://gnu-octave.github.io/statistics/pdf.html pdf]
| This is a wrapper for the NAMEpdf and NAME_pdf functions available in the statistics package.
|-
| [https://gnu-octave.github.io/statistics/random.html random]
| Generates pseudo-random numbers from a given one-, two-, or three-parameter distribution.
|}


[[Category:Packages]]
[[Category:Octave Forge]]
[[Category:Missing functions]]
[[Category:Missing functions]]
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)