Contents
1 Getting Started
1.1 Overview
1.2 Running BayES
1.2.1 Running BayES in interactive mode
1.2.2 Running BayES from the command shell
1.3 Quick start for the impatient: video tutorials
1.4 How to use this document
2 The BayES Language
2.1 Introduction
2.1.1 Writing and submitting code
2.1.2 Using the sample files that come with BayES
2.2 Arithmetic operations
2.3 Matrices and matrix calculations
2.3.1 Defining and using matrices
2.3.2 Indexing matrices and the range operator
2.3.3 Element-wise operators
2.3.4 Operator precedence
2.3.5 Functions operating on matrices
2.4 Datasets and data transformations
2.5 Models
2.6 Structures
2.7 Strings
2.8 Data types and assignments
2.9 Program flow
2.9.1 Boolean expressions and operators
2.9.2 if-else statements
2.9.3 for loops
2.9.4 while loops
2.10 User-defined functions
2.10.1 Rules for defining and calling functions
2.11 Plotting
3 Interfaces to external programs
3.1 Overview
3.2 Interface to JAGS
3.3 Interface to OpenBUGS
3.4 Interface to Stan
3.5 Interface to R
3.6 Interface to Stata
3.7 Interface to MATLAB
3.8 Interface to GNU Octave
3.9 The system function
4 Linear Models
4.1 Basic linear model
4.2 Heteroskedastic linear model
4.3 Random-effects linear model
4.4 Random-coefficients linear model
4.5 Latent-class linear model
4.6 Latent-class linear model with panel data
5 Stochastic Frontier Models
5.1 Simple stochastic frontier
5.2 Inefficiency-effects stochastic frontier
5.3 Random-effects stochastic frontier
5.4 Random-coefficients stochastic frontier
5.5 Latent-class stochastic frontier
5.6 Latent-class stochastic frontier model with panel data
5.7 Dynamic stochastic frontier
5.8 Random-effects dynamic stochastic frontier
6 Discrete Choice Models
6.1 Binary Probit
6.2 Binary Logit
6.3 Random-effects binary Probit
6.4 Random-effects binary Logit
6.5 Multinomial Probit
6.6 Multinomial Logit
6.7 Conditional Probit
6.8 Conditional Logit
6.9 Multivariate Probit
7 Models for Ordered Data
7.1 Ordered Probit model
7.2 Ordered Logit model
8 Models for Count Data
8.1 Poisson model
8.2 Negative-Binomial model
9 Models for Censored/Truncated Dependent Variables
9.1 Type I Tobit
9.2 Type II Tobit
10 Linear Systems of Equations
10.1 Simple Seemingly Unrelated Regressions (SUR)
11 VAR and VEC Models
11.1 Vector Autoregressive (VAR) model for time-series data
A Installation Guide
A.1 Installation under Microsoft Windows
A.2 Installation under Linux
A.3 Installation under macOS
A.4 Unstalling BayES
B List of functions and commands
B.1 Directory statements
B.2 Console statements
B.3 Elapsed-time statements
B.4 Import, export and memory management
B.5 Size information, reshaping/replicating & cleaning
B.6 Special matrices
B.7 Simple mathematical functions
B.8 Matrix decompositions & quadratures
B.9 Statistical functions, summing, rounding & sorting
B.10 Error function, Beta, Gamma and related mathematical functions
B.11 Probability and cumulative density functions
B.12 Random-number generators
B.12.1 Univariate distributions
B.12.2 Multivariate distributions
B.13 Statements for working with datasets
B.14 Statements for post-estimation analysis
B.15 Statements for working with strings
B.16 Plotting
B.17 system, run, pause and eval statements
1.1 Overview
1.2 Running BayES
1.2.1 Running BayES in interactive mode
1.2.2 Running BayES from the command shell
1.3 Quick start for the impatient: video tutorials
1.4 How to use this document
2 The BayES Language
2.1 Introduction
2.1.1 Writing and submitting code
2.1.2 Using the sample files that come with BayES
2.2 Arithmetic operations
2.3 Matrices and matrix calculations
2.3.1 Defining and using matrices
2.3.2 Indexing matrices and the range operator
2.3.3 Element-wise operators
2.3.4 Operator precedence
2.3.5 Functions operating on matrices
2.4 Datasets and data transformations
2.5 Models
2.6 Structures
2.7 Strings
2.8 Data types and assignments
2.9 Program flow
2.9.1 Boolean expressions and operators
2.9.2 if-else statements
2.9.3 for loops
2.9.4 while loops
2.10 User-defined functions
2.10.1 Rules for defining and calling functions
2.11 Plotting
3 Interfaces to external programs
3.1 Overview
3.2 Interface to JAGS
3.3 Interface to OpenBUGS
3.4 Interface to Stan
3.5 Interface to R
3.6 Interface to Stata
3.7 Interface to MATLAB
3.8 Interface to GNU Octave
3.9 The system function
4 Linear Models
4.1 Basic linear model
4.2 Heteroskedastic linear model
4.3 Random-effects linear model
4.4 Random-coefficients linear model
4.5 Latent-class linear model
4.6 Latent-class linear model with panel data
5 Stochastic Frontier Models
5.1 Simple stochastic frontier
5.2 Inefficiency-effects stochastic frontier
5.3 Random-effects stochastic frontier
5.4 Random-coefficients stochastic frontier
5.5 Latent-class stochastic frontier
5.6 Latent-class stochastic frontier model with panel data
5.7 Dynamic stochastic frontier
5.8 Random-effects dynamic stochastic frontier
6 Discrete Choice Models
6.1 Binary Probit
6.2 Binary Logit
6.3 Random-effects binary Probit
6.4 Random-effects binary Logit
6.5 Multinomial Probit
6.6 Multinomial Logit
6.7 Conditional Probit
6.8 Conditional Logit
6.9 Multivariate Probit
7 Models for Ordered Data
7.1 Ordered Probit model
7.2 Ordered Logit model
8 Models for Count Data
8.1 Poisson model
8.2 Negative-Binomial model
9 Models for Censored/Truncated Dependent Variables
9.1 Type I Tobit
9.2 Type II Tobit
10 Linear Systems of Equations
10.1 Simple Seemingly Unrelated Regressions (SUR)
11 VAR and VEC Models
11.1 Vector Autoregressive (VAR) model for time-series data
A Installation Guide
A.1 Installation under Microsoft Windows
A.2 Installation under Linux
A.3 Installation under macOS
A.4 Unstalling BayES
B List of functions and commands
B.1 Directory statements
B.2 Console statements
B.3 Elapsed-time statements
B.4 Import, export and memory management
B.5 Size information, reshaping/replicating & cleaning
B.6 Special matrices
B.7 Simple mathematical functions
B.8 Matrix decompositions & quadratures
B.9 Statistical functions, summing, rounding & sorting
B.10 Error function, Beta, Gamma and related mathematical functions
B.11 Probability and cumulative density functions
B.12 Random-number generators
B.12.1 Univariate distributions
B.12.2 Multivariate distributions
B.13 Statements for working with datasets
B.14 Statements for post-estimation analysis
B.15 Statements for working with strings
B.16 Plotting
B.17 system, run, pause and eval statements