Mathematical functions#
Scientific functions#
Returns absolute value of argument. |
|
Computes inverse cosine. |
|
Computes inverse sine. |
|
Computes inverse tangent. |
|
Computes angle given a point \(x\),:math: |
|
Computes Bessel function, first kind. |
|
Computes the modified Bessel function of the second kind, \(K_n(x)\). |
|
Computes Bessel function, second kind. |
|
Computes the complete Beta function, also called the Euler integral. |
|
Computes the Box-Cox function. |
|
Computes cosine. |
|
Computes hyperbolic cosine. |
|
Computes a one-dimensional smoothing curve. |
|
Computes the digamma function. |
|
Computes the exponential function of \(x\). |
|
Computes the floating-point remainder of \(x/y\). |
|
Computes gamma function value. |
|
Computes gamma function for complex inputs. |
|
Compute the inverse incomplete gamma function. |
|
Computes the natural log of each element. |
|
Computes natural log of factorial function. |
|
Computes the natural log of the gamma function. |
|
Computes the log (base 10) of each element. |
|
Computes modified and exponentially scaled modified Bessels of the first kind of the nth order. |
|
Returns the constant, \(\pi\). |
|
Computes the polygamma function of order \(n\). |
|
Computes the psi (or digamma) function. |
|
Computes sine. |
|
Computes the hyperbolic sine. |
|
Computes a two-dimensional interpolatory spline. |
|
Computes the square root of each element. |
|
Computes tangent. |
|
Computes hyperbolic tangent. |
|
Converts from polar to Cartesian coordinates. |
|
Converts from Cartesian to polar coordinates. |
|
Computes trigamma function. |
|
Computes the Rieman zeta function. |
Differentiation and Integration#
Computes first derivative of a function. |
|
Computes second derivative of a function. |
|
Integrates a user-defined function over a user-defined range, using adaptive quadrature. |
|
Integrates a 2-dimensional function over an user-defined region. |
|
Integrates a 3-dimensional function over an user-defined region. |
|
Integrates a 1-dimensional function. |
|
Integrates a 2-dimensional function over an user-defined rectangular region. |
|
Integrates a 3-dimensional function over an user-defined rectangular region. |
|
Integrates by Simpson’s method. |
The following are differentiation functions with advanced options.
Computes numerical gradient with mask. |
|
Computes numerical gradient using available threads. |
|
Computes numerical gradient with mask using available threads. |
|
Computes numerical Hessian using gradient procedure. |
|
Computes numerical Hessian using gradient procedure with weights. |
|
Computes numerical Hessian with mask. |
|
Computes numerical Hessian with mask and weights. |
|
Computes numerical Hessian using available threads. |
|
Computes numerical Hessian using gradient procedure with available threads. |
|
Computes numerical Hessian using gradient procedure with weights and using available threads. |
|
Computes numerical Hessian with mask and available threads. |
|
Computes numerical Hessian with weights. |
Linear Algebra#
Balances a matrix. |
|
Extracts bands from a symmetric banded matrix. |
|
Computes the Cholesky decomposition of a positive definite banded matrix. |
|
Solves the system of equations \(Ax = b\) for \(x\), given the lower triangle of the Cholesky decomposition of a positive definite banded matrix \(A\). |
|
Solves the system of equations \(Ax = b\) for \(x\), where \(A\) is a lower triangular banded matrix |
|
Creates a symmetric banded matrix, given its compact form. |
|
Solves the system of equations \(Ax = b\) for \(x\), where \(A\) is a positive definite banded matrix. |
|
Creates a block-diagonal matrix from one or more input matrices |
|
Computes Cholesky decomposition, \(X=U'U\). |
|
Performs Cholesky downdate on an upper triangular matrix. |
|
Solves a system of equations given the Cholesky factorization of a matrix. |
|
Performs Cholesky update on an upper triangular matrix. |
|
Computes condition number of a matrix. |
|
Computes Crout decomposition, \(X = LU\) (real matrices only). |
|
Computes Crout decomposition with row pivoting (real matrices only). |
|
Computes determinant of square matrix. |
|
Computes determinant of decomposed matrix. |
|
Returns a scalar dot product of the columns of two matrices. |
|
Computes upper Hessenberg form of a matrix (real matrices only). |
|
Inverts a square or positive-definite matrices, respectively. |
|
Computes a generalized sweep inverse. |
|
Computes eigenvalues only of a real symmetric or complex Hermitian matrix selected by bounds. |
|
Computes eigenvalues only of a real symmetric or complex Hermitian matrix selected by index. |
|
Computes eigenvalues and eigenvectors of a real symmetric or complex Hermitian matrix selected by bounds. |
|
Computes selected eigenvalues and eigenvectors of a real symmetric or complex Hermitian matrix. |
|
Computes generalized eigenvalues for a pair of real or complex general matrices. |
|
Computes generalized eigenvalues for a pair of real symmetric or Hermitian matrices. |
|
Computes generalized eigenvalues and eigenvectors for a pair of real symmetric or Hermitian matrices. |
|
Computes generalized eigenvalues, left eigenvectors, and right eigenvectors for a pair of real or complex general matrices. |
|
Computes the generalized Schur form of a pair of real or complex general matrices. |
|
Computes the generalized singular value decomposition of a pair of real or complex general matrices. |
|
Computes the generalized singular value decomposition of a pair of real or complex general matrices. |
|
Computes the generalized singular value decomposition of a pair of real or complex general matrices. |
|
Computes the \(L\) and \(D\) factors of the LDL factorization of a real symmetric matrix. |
|
Computes \(LDL\) decomposition with row pivoting of a symmetric matrix. |
|
Computes Solves the system of equations \(LDLTx = b\) using a matrix factorized by ldlp. |
|
Computes \(LU\) decomposition with row pivoting (real and complex matrices). |
|
Computes Solves the system of equations \(LUx = b\). |
|
Computes one of several specified matrix norms, or a vector p-norm. |
|
Computes orthonormal basis for right null space. |
|
Computes orthonormal basis for right null space. |
|
Computes orthonormal basis for column space \(x\). |
|
Generalized pseudo-inverse: Moore-Penrose. |
|
Generalized pseudo-inverse: Moore-Penrose. |
|
Computes the power \(n\) of a matrix \(A\), as the mathematical equivalent of the matrix product of \(n\) copies of \(A\). |
|
\(QR\) decomposition: returns \(Q_1\) and \(R\). |
|
\(QR\) decomposition: returns \(Q_1\), \(R\) and a permutation vector, \(E\). |
|
\(QR\) decomposition with pivot control: returns \(Q_1\), \(R\), and \(E\). |
|
\(QR\) decomposition: returns \(R\). |
|
\(QR\) decomposition: returns \(R\) and \(E\). |
|
\(QR\) decomposition with pivot control: returns \(R\) and \(E\). |
|
Solves a system of equations \(R'x = b\) given an upper triangular matrix, typically the \(R\) matrix from a \(QR\) decomposition. |
|
Solves a system of equations \(Rx = b\) given a lower triangular matrix, typically a transposed \(R\) matrix from a \(QR\) decomposition. |
|
\(QR\) decomposition: returns \(Q'Y\) and \(R\). |
|
\(QR\) decomposition: returns \(Q'Y\), \(R\) and \(E\). |
|
\(QR\) decomposition with pivot control: returns \(Q'Y\), \(R\) and \(E\). |
|
\(QR\) decomposition: returns \(QY\) and \(R\). |
|
\(QR\) decomposition: returns \(QY\), \(R\) and \(E\). |
|
\(QR\) decomposition with pivot control: returns \(QY\), \(R\) and \(E\). |
|
Compute the complex \(QZ\), or generalized Schur, form of a pair of real or complex general matrices with an option to sort the eigenvalues. |
|
Computes rank of a matrix. |
|
Computes reduced row echelon form of a matrix. |
|
Reduces any 2x2 blocks on the diagonal of the real Schur form of a matrix returned from schur. The transformation matrix is also updated. |
|
Computes real or complex Schur decomposition of a matrix. |
|
Solves a system of positive definite linear equations. |
|
Computes the singular values of a matrix. |
|
Computes singular value decomposition, \(X = USV'\). |
|
Computes the singular value decomposition \(X = USV'\) with compact \(U\). |
|
Computes the singular value decomposition of a matrix so that: \(X = U S V'\) (compact \(U\)). |
|
Computes the singular values of a matrix. |
|
Computes the singular value decomposition of a matrix so that: \(X = U S V'\). |
|
Computes the solution to the Sylvester matrix equation, \(AX + XB = C\). |
|
Computes the trace of a matrix. |
Eigenvalues#
Polynomial Operations#
Computes characteristic polynomial of a square matrix. |
|
Evaluates polynomial with given coefficients. |
|
Calculates Nth order polynomial interpolation given known point pairs. |
|
Computes polynomial coefficients from roots. |
|
Returns sequence powers of a matrix. |
|
Multiplies two polynomials together. |
|
Computes roots of polynomial from coefficients. |
Fourier Transforms#
Computes discrete 1-D FFT. |
|
Computes inverse discrete 1-D FFT. |
|
Computes 1- or 2-D FFT. |
|
Computes inverse 1- or 2-D FFT. |
|
Computes multi-dimensional FFT. |
|
Computes inverse multi-dimensional FFT. |
|
Computes 1- or 2-D FFT using prime factor algorithm. |
|
Computes real 1- or 2-D FFT. |
|
Computes inverse real 1- or 2-D FFT. |
|
Computes inverse real 1- or 2-D FFT from packed format FFT. |
|
Computes real 1- or 2-D FFT using prime factor algorithm. |
|
Computes real 1- or 2-D FFT using prime factor algorithm, returns packed format FFT. |
|
Computes real 1- or 2-D FFT, returns packed format FFT. |
Fuzzy Conditional Functions#
Fuzzy .==, .>=, .>, .<=, .<, .!= |
|
Fuzzy .==, .>=, .>, .<=, .<, .!= |
|
Fuzzy ==, >=, >, <=, <, != |
|
Fuzzy ==, >=, >, <=, <, != |
The mt commands use an fcmptol argument to control the tolerance used for comparison. The non-mt commands use the global variable _fcmptol to control the tolerance used for comparison. By default, this is 1e-15. The default can be changed by editing the file fcompare.dec.
Statistical Functions#
Computes sample autocorrelations. |
|
Computes the standard deviation of the elements across one dimension of an N-dimensional array. |
|
Computes the ‘sample’ standard deviation of the elements across one dimension of an N-dimensional array. |
|
Computes probability of chi-bar-square statistic. |
|
Computes the White cluster-robust standard errors. |
|
Computes combinations of \(n\) things taken \(k\) at a time. |
|
Writes combinations of \(n\) things taken \(k\) at a time to a GAUSS data set. |
|
Computes constrained score statistic and its probability. |
|
Computes convolution of two vectors. |
|
Computes an unbiased estimate of a correlation matrix from a moment matrix, variance-covariance matrix or general matrix. |
|
Computes cross product. |
|
Creates a design matrix of 0’s and 1’s. |
|
Computes descriptive statistics of a data set or matrix. |
|
Computes the Durbin-Watson statistic. |
|
Computes a scalar dot product of the columns of two matrices. |
|
Computes descriptive statistics on multiple Nx1 variables in a GDA. |
|
Computes descriptive statistics on a selection of columns in a variable in a GDA. |
|
Computes generalized linear regression of a matrix. |
|
Computes generalized method of moments estimates from user specified moment function. |
|
Estimate instrumental variables model using the generalized method of moments. |
|
Computes coefficients of locally weighted regression. |
|
Computes coefficients of locally weighted regression. |
|
Computes mean value of each column of a matrix. |
|
Computes medians of the columns of a matrix. |
|
Computes moment matrix (\(x'x\)) with special handling of missing values. |
|
Computes moment matrix from a data set. |
|
Computes moving average of a series. |
|
Computes exponentially weighted moving average of a series. |
|
Computes weighted moving average of a series. |
|
Computes number of combinations of \(n\) things taken \(k\) at a time. |
|
Computes least squares regression of data set or matrix. |
|
Computes least squares regression of data set or matrix. |
|
Computes OLS coefficients using \(QR\) decomposition. |
|
Computes OLS coefficients, residuals, and predicted values using \(QR\) decomposition. |
|
Computes OLS coefficients using \(QR\) decomposition. |
|
Computes sample partial autocorrelations. |
|
Computes principal components of a data matrix. |
|
Computes quantiles from data in a matrix, given specified probabilities. |
|
Computes quantiles from data in a data set, given specified probabilities. |
|
Perform linear quantile regression. |
|
Perform local linear or quadratic quantile regression. |
|
Computes the Huber-White heteroscedastic robust standard errors. The procedure uses the “sandwich” variance-covariance estimator with a small sample correction of \((n)/(n-1)\). |
|
Computes standard deviation of the columns of a matrix. |
|
Computes Toeplitz matrix from column vector. |
|
Computes the log-likelihood of a Vector ARMA model. |
|
Computes the residuals of a Vector ARMA model. |
|
Computes an unbiased estimate of a variance-covariance matrix from a matrix \(x\) or a moment matrix, \(x'x\). |
Series and Sequence Functions#
Computes autoregressive recursive series. |
|
Computes recursive series involving products. |
|
Computes recursive series involving division. |
|
Computes a vector autoregressive recursive. |
|
Creates an additive or multiplicative sequence, respectively. |
|
Creates a sequence of dates in DT scalar format. |
|
Creates a sequence of dates in posix date format, returned as a dataframe date variable. |
Precision Control#
Converts number to x.xxx and a power of 10. |
|
Rounds up towards \(+\infty\). |
|
Rounds towards 0. |
|
Rounds down towards \(-\infty\). |
|
Returns the smallest number such that \(1 + eps > 1\). |
|
Rounds to the nearest integer. |
|
Converts numbers to integers by truncating the fractional portion. |