GAUSS (software)
GAUSS is a programming language built around the matrix, a rectangular table of numbers. Most of its operators (the symbols or words that tell the program what operation to perform) work on whole matrices at once, so one line of code can add or multiply entire tables of numbers.[1]
Aptech Systems has developed GAUSS since 1984. It is used mainly for statistics, econometrics, and data analysis.[2]
The matrix design makes it easy to write new estimators (methods that use data to estimate unknown values) and statistical tests. As a result, GAUSS became very popular with econometricians, the economists who apply statistical methods to economic data.[3]
Overview
GAUSS is a domain-specific language for linear algebra and statistical computing. It is not a general-purpose language that relies on add-on libraries (packages of reusable code that add features to a program) for this work. Aptech describes it as designed from the start for matrix mathematics, with matrix operations built into the language itself.[2]
| Attribute | Detail |
|---|---|
| Developer | Aptech Systems[2] |
| First released | 1984[2] |
| Main uses | Statistics, econometrics, data analysis[2] |
| Current major version | GAUSS 26[4] |
| Platforms (GAUSS 26) | 64-bit Windows 10 and later, macOS 11 and later, and Linux (Red Hat 8 and later, CentOS, Ubuntu)[4] |
| Licensing | Commercial, supplied under a license agreement[5] |
Matrices as the basic data type
In GAUSS, every value is a matrix. A single number (a scalar) is a 1×1 matrix, and a vector is an N×1 or 1×N matrix.[2]
- Matrix literals use curly braces. Spaces separate columns and commas separate rows, so
{ 1 2, 3 4 }is a 2×2 matrix with rows [1 2] and [3 4].[1] - Indexing uses square brackets and starts at 1, as in R and MATLAB.
x[2, 3]is row 2, column 3.[1] - A dot means "all", so
x[., 1]is the whole first column. A colon gives a range, sox[1:2, .]is rows 1 to 2.[1] - Dataframes extend matrices with column names and column types: numeric, string, date, or category.[2]
Operators
Most GAUSS operators work on whole matrices. The key idea is the difference between matrix operators, which follow the rules of linear algebra, and element-wise operators, which act on each entry separately. Element-wise operators start with a dot.[1]
Matrix and element-wise operators
| Operator | Meaning |
|---|---|
* |
Matrix product (N×K times K×M gives N×M) |
.* |
Element-wise product |
/ |
Matrix division (see Solving linear systems below) |
./ |
Element-wise division |
^ or .^ |
Element-wise power (both forms are the same) |
' |
Transpose (swap rows and columns) |
.*. |
Kronecker product |
The values an operator acts on are called its operands.
If either operand of * or / is a scalar, GAUSS does element-wise multiplication or division instead.[1][6]
Unlike MATLAB, GAUSS has no matrix power operator, and ^ is always element-wise.[1]
* computes row-by-column sums, so the top-left entry is . The element-wise product .* multiplies entries in the same position, so the top-left entry is .Building matrices
Two operators join matrices together.[1]
~joins matrices side by side. They must have the same number of rows.|stacks matrices top to bottom. They must have the same number of columns.
Broadcasting
Element-wise operators do not need operands of exactly the same size. GAUSS stretches the smaller one to match, a rule its documentation calls ExE conformability.[1]
- A scalar works with any matrix and is applied to every element.
- An N×1 column vector works with an N×K matrix and is applied to each column.
- A 1×K row vector works with an N×K matrix and is applied to each row.
- An N×1 column and a 1×K row combine into an N×K result, as in the documentation's example of a 3×1 column times a 1×4 row.
The same rules apply to + and -. If sizes are not compatible, GAUSS stops with the error "Matrix dimensions are incompatible".[1]
Solving linear systems
Matrix division solves equations directly. For matrices a and b, the expression a / b returns the least-squares solution of , which is the x that makes the sum of squared errors as small as possible. This solution is , and when b is square and invertible (has an inverse matrix) it is inv(b) * a.[3][1][6]
This makes ordinary least squares (OLS) a one-line task. OLS is a standard way to fit a linear model, which predicts an outcome as a weighted sum of input variables. The weights are called coefficients, and OLS estimates them as
- is the column of estimated coefficients.
- is the column of observed outcomes.
- is the matrix of explanatory variables, the inputs used to explain the outcome, with one column per variable.
- is the transpose of .
The formula requires to be invertible. This holds exactly when the columns of are linearly independent, meaning no column can be made by adding weighted copies of the others.
GAUSS has a shorthand for this: when ' is directly followed by a variable name, X'Y means X' * Y.[1] Since y / X equals , the formula can be written in either of two ways.
// Formula form
b = inv(X'X) * (X'y);
// Matrix division gives the least-squares solution
b = y / X;
The documentation warns that the shorthand only works in the simple form X'Y, so compound expressions need parentheses.[1]
Procedures and libraries
User-defined functions in GAUSS are called procedures. A definition starts with proc, returns results with retp(), and ends with endp.[7]
// Standardize a column vector
proc (1) = standardize(x);
local mu, sd;
mu = meanc(x);
sd = stdc(x);
retp((x - mu) ./ sd);
endp;
The number in proc (1) is how many values the procedure returns. Each retp() must return exactly that many.[7]
- Local variables: variables declared with
localexist only while the procedure runs. Withoutlocal, a variable assigned inside a procedure becomes global, meaning it is visible everywhere in the program.[7] - Multiple returns: a procedure can return up to 1023 values, and the caller collects them in curly braces.[7]
- Keywords: a keyword is a special procedure that takes exactly one string argument and returns nothing. It is called without parentheses.[7]
- Libraries: libraries group related procedures and are loaded with
library libname;.[2] - Foreign code: GAUSS has a foreign language interface, a feature that lets a GAUSS program call code written in another programming language. It uses dynamic libraries, which are files of compiled code that a program loads while it runs.[5] A 1989 review by Nick Higham noted that GAUSS already had facilities for directly calling compiled C and Fortran subroutines.[8]
How GAUSS runs programs
GAUSS works in two stages, which its user guide calls compile time and execution time. A 2002 Aptech user guide describes GAUSS as both a compiler and an interpreter.[5]
- GAUSS scans the whole program once and translates it into pseudocode, a compact binary code that is not the processor's own machine code.
- GAUSS then reads and carries out (interprets) each pseudocode instruction in turn.
- The time lost to interpreting is largely made up by fast matrix and vector operations.
The same guide gives two reasons for the speed.[5]
- GAUSS has a fast interpreter, and its pseudocode is compact and efficient.
- More important, GAUSS is a matrix language, so problems are written as matrix or vector equations.
Aptech's current documentation describes GAUSS differently. It says GAUSS compiles to native code, meaning instructions the processor can run directly, and uses optimized numerical libraries.[2]
GAUSS can be used interactively in its graphical interface or in batch mode, where a program runs from start to finish without user input, for example on servers.[2]
Built-in tools and add-ons
Aptech lists many methods as available either built in or through add-on packages.[2]
- Time series, data recorded over time:
- ARIMA (autoregressive integrated moving average)
- GARCH (generalized autoregressive conditional heteroskedasticity)
- vector autoregression (VAR)
- vector error correction models (VECM), which model how related series return toward a long-run relationship
- state-space models, which track a hidden state from observed data
- Kalman filtering
- Estimation:
- OLS, generalized least squares (GLS), and instrumental variables
- the generalized method of moments (GMM) and maximum likelihood
- Bayesian methods, which update prior beliefs with new data, using Markov chain Monte Carlo (MCMC)
- Panel data:
- fixed effects, which give each group its own constant term that stays the same over time[9]
- random effects, which treat group differences as random draws from a distribution[9]
- dynamic panels, which use past values of the outcome as inputs[9]
- clustered standard errors, which allow the errors within a group to be correlated[10]
- Discrete choice, models of choosing among options:
- logit and probit models, which estimate the probability of each choice from input data[11]
- multinomial models for several options
- mixed logit models, which let preferences vary across people
- nested logit models, which group similar options
- General computing:
- matrix algebra
- numerical optimization (finding the best value of a function)
- Monte Carlo simulation
Application modules
Aptech sells application modules, which are pre-written GAUSS programs that users can change. They run on Windows, Mac, and Linux.[12] The current list includes:[13]
- Algorithmic Derivatives and Bayesian Estimation Tools
- Constrained Maximum Likelihood MT and Maximum Likelihood MT
- Constrained Optimization MT, Optimization MT, and Linear Programming MT
- Discrete Choice Analysis Tools
- FANPAC MT, Time Series MT, and CurveFit
- Linear Regression MT, Loglinear Analysis MT, and Nonlinear Equations MT
In the mid-1990s, GAUSSX, written by Jon Breslaw and sold as an option through Aptech, turned GAUSS into a command-driven econometrics package similar to TSP.[3]
Users
Aptech says GAUSS is used by these groups:[2]
- central banks
- academic economists
- financial institutions
- government agencies
- transportation researchers working on discrete choice models
History
GAUSS was introduced in 1984, and Aptech has developed it since then.[2]
| Year | Event |
|---|---|
| 1989 | Judge and coauthors published Learning Econometrics Using Gauss. In the mid-1990s, Pierse called it the only English-language book on GAUSS.[3] |
| 1992 | Richard G. Anderson reviewed the GAUSS programming system in the Journal of Applied Econometrics.[14] |
| 1993 | John Rust compared GAUSS with MATLAB in the same journal.[15] |
| Mid-1990s | Pierse's teaching notes covered version 3.x for DOS and mentioned versions for Unix and Linux. A version for Windows 95 and Windows NT was then in beta test.[3] |
| Today | GAUSS 26 runs on 64-bit Windows, macOS, and Linux.[4] |
Early GAUSS was a language rather than an econometrics package. Pierse noted that its supplied procedures held only one econometrics routine, ols. He said users wrote their own estimators, and that the GAUSS language had become "a standard medium by which econometricians communicate".[3]
Comparison with other tools
Pierse placed GAUSS in a different class from most statistical software used by economists.[3]
| Kind of software | Examples | How users work |
|---|---|---|
| Menu-driven | MicroFit, PcGive | Pick methods from menus |
| Command-driven | TSP, RATS, EViews | Run fixed commands for set estimators and tests |
| Matrix language | GAUSS | Program any estimator or test from matrix operations |
He advised using GAUSS mainly for methods the packages lacked, such as Monte Carlo and bootstrap simulations.[3]
GAUSS and MATLAB
Rust's 1993 review found the two languages "remarkably similar in terms of their features and performance".[15]
He still found differences in their strengths and best uses.[15] Macroeconometric work studies whole economies, and microeconometric work studies individual people, households, or firms.
| Point | GAUSS | MATLAB |
|---|---|---|
| Main advantage | Better coverage of statistical and econometric routines | Ran on more kinds of hardware and operating systems |
| Best suited to | Panel data and other microeconometric work | Time-series data and other macroeconometric work |
Comparison today
Aptech's own comparison describes MATLAB as engineering-focused and Stata and EViews as command-based. It gives both GAUSS and MATLAB native matrix syntax.[2]
Aptech also publishes guides for users switching from Stata, EViews, MATLAB, R, and Python with NumPy.[2]
References
- Operators and Expressions, GAUSS 26 documentation, Aptech Systems, 2026.
- What is GAUSS?, GAUSS 26 documentation, Aptech Systems, 2026.
- Gauss for Econometrics: An Introduction, R. G. Pierse, lecture notes, about 1996.
- License Request, Aptech Systems, 2026.
- GAUSS User Guide, version 4.0, Aptech Systems, 2002.
- Operators, GAUSS 26 documentation, Aptech Systems, 2026.
- Procedures and Keywords, GAUSS 26 documentation, Aptech Systems, 2026.
- Matrix Computations on a PC, Nick Higham, SIAM News, January 1989.
- Introduction to the Fundamentals of Panel Data, Aptech Systems blog.
- A Practitioner's Guide to Cluster-Robust Inference, A. Colin Cameron and Douglas L. Miller, Journal of Human Resources, 2015.
- Discrete Choice Methods with Simulation, Kenneth Train, Cambridge University Press, 2002.
- GAUSS Applications, Aptech Systems, 2026.
- GAUSS Application Modules, Aptech Systems, 2026.
- The GAUSS Programming System: A Review, Richard G. Anderson, Journal of Applied Econometrics 7(2): 215 to 219, 1992.
- GAUSS and MATLAB: A Comparison, John Rust, Journal of Applied Econometrics 8(3): 307 to 324, 1993.
