OxMetrics Books' Tables of Contents


Books

Doornik, J.A. and Hendry, D.F. (2001). GiveWin: An Interface to Empirical Modelling, London: Timberlake Consultants Press. (ISBN 0-9533394-3-2)

Chapter List of Figures . . . . . . xv
Chapter List of Tables . . . . . . xvi
Chapter Preface . . . . . . xvii
PART I GiveWin Prologue . . . . . . 1
Chapter  1 Introduction . . . . . . 3
1.1  GiveWin 2: what is new? . . . . . . 3
1.2  Documentation conventions . . . . . . 4
1.3  Help . . . . . . 4
1.4  Modular structure . . . . . . 4
1.5  Installation and upgrades . . . . . . 5
1.6  Registration . . . . . . 5
1.7  Interactive operation . . . . . . 6
1.8  Menu structure . . . . . . 6
1.9  Data samples . . . . . . 7
1.10  Data storage . . . . . . 7
1.11  Results storage . . . . . . 7
1.12  Filenames and their extensions . . . . . . 8
1.13  GiveWin languages . . . . . . 8
1.13.1  Algebra . . . . . . 8
1.13.2  GiveWin batch language . . . . . . 9
1.14  Registry . . . . . . 9
1.15  Citation . . . . . . 9
1.16  Contact information and World Wide Web . . . . . . 9
Chapter  2 Getting Started . . . . . . 10
2.1  Starting GiveWin . . . . . . 11
2.2  Registering GiveWin . . . . . . 11
2.3  Loading and viewing the tutorial data set . . . . . . 12
2.4  GiveWin graphics . . . . . . 15
2.4.1  A first graph . . . . . . 15
2.4.2  Multiple graphs . . . . . . 17
2.4.3  Graph saving and printing . . . . . . 19
2.4.4  Using the clipboard for graph pasting . . . . . . 19
2.5  Calculator . . . . . . 20
2.6  Algebra . . . . . . 22
2.7  The workspace . . . . . . 24
2.8  The main toolbar . . . . . . 26
Chapter  3 GiveWin Modules . . . . . . 27
3.1  Introduction . . . . . . 27
3.2  PcGive . . . . . . 28
3.3  TSP  29
3.3.1  TSP in interactive mode . . . . . . 29
3.3.2  TSP in batch mode . . . . . . 32
3.3.3  Explorer options . . . . . . 32
PART II GiveWin Tutorials . . . . . . 33
Chapter  4 Tutorial on Graph Editing . . . . . . 35
4.1  Multiple graphs . . . . . . 35
4.2  Graphics paper: areas and coordinates . . . . . . 35
4.3  Graphics view . . . . . . 37
4.4  Copy and paste . . . . . . 37
4.5  About line colour and style . . . . . . 38
4.6  Editing graphs: Graphics properties . . . . . . 38
4.7  Graphics setup . . . . . . 41
4.8  Drawing . . . . . . 43
4.9  Adding text and variables . . . . . . 44
4.10  Legends . . . . . . 46
4.11  Scaling variables . . . . . . 46
Chapter  5 Tutorial on Graphics . . . . . . 48
5.1  Descriptive graphics . . . . . . 48
5.2  Actual series . . . . . . 50
5.3  Transformed series . . . . . . 51
5.4  Scatter plots . . . . . . 52
5.5  Distribution . . . . . . 54
5.5.1  Histogram and density . . . . . . 54
5.5.2  Distribution . . . . . . 55
5.5.3  Frequency chart . . . . . . 55
5.5.4  Box plot . . . . . . 56
5.6  Time-series: ACF etc. . . . . . . 56
5.6.1  Autocorrelation function . . . . . . 56
5.6.2  Partial autocorrelation function (PACF) . . . . . . 57
5.6.3  Cross-correlation function . . . . . . 57
5.6.4  Spectrum and periodogram . . . . . . 57
5.7  QQ plots . . . . . . 58
5.8  Two series by a third . . . . . . 60
5.9  3-dimensional plots . . . . . . 63
5.9.1  Surface from scatter . . . . . . 63
5.9.2  Surface from table . . . . . . 65
Chapter  6 Tutorial on Data Input and Output . . . . . . 67
6.1  Open Data File and file types . . . . . . 68
6.2  From paper to GiveWin . . . . . . 69
6.2.1  Directly into the database . . . . . . 69
6.2.2  Using the clipboard; using GiveWin as editor . . . . . . 72
6.3  From GiveWin to disk . . . . . . 73
6.4  From disk to GiveWin . . . . . . 74
6.4.1  Loading GiveWin files . . . . . . 74
6.4.2  Loading spreadsheet files . . . . . . 75
6.4.3  Loading a human-readable (ASCII) file . . . . . . 76
6.5  Adding variables using the clipboard . . . . . . 77
6.6  Changing the sample period . . . . . . 77
6.6.1  Extending the sample period . . . . . . 77
6.6.2  Reset starting date . . . . . . 78
6.7  Appending data . . . . . . 78
Chapter  7 Tutorial on Data Transformation . . . . . . 79
7.1  Calculator . . . . . . 79
7.2  Advanced algebra . . . . . . 81
7.2.1  Introduction . . . . . . 81
7.2.2  Database for advanced algebra . . . . . . 81
7.2.3  Statistical distributions . . . . . . 81
7.2.4  Random number generators . . . . . . 85
7.2.5  Generating data . . . . . . 86
7.2.6  Smoothing data . . . . . . 89
PART III GiveWin Reference . . . . . . 91
Chapter  8 GiveWin Statistics . . . . . . 93
8.1  Actual values and scatter plots . . . . . . 93
8.2  Mean, standard deviation and variance . . . . . . 93
8.3  Correlogram, ACF . . . . . . 93
8.4  Partial autocorrelation function (PACF) . . . . . . 94
8.5  Cross-correlation function . . . . . . 94
8.6  Periodogram . . . . . . 95
8.7  Spectral density . . . . . . 95
8.8  Histogram, estimated density and distribution . . . . . . 96
8.9  Regression lines and smooths . . . . . . 96
8.9.1  Kernel smooth . . . . . . 97
8.9.2  Spline smooth . . . . . . 98
8.10  QQ plot . . . . . . 100
8.11  Box plot . . . . . . 100
Chapter  9 GiveWin file formats . . . . . . 101
9.1  GiveWin data files (.IN7/.BN7) . . . . . . 101
9.1.1  The .IN7 file format . . . . . . 101
9.1.2  The .BN7 file format . . . . . . 103
9.1.3  The information and ASCII data files (.IN7/.DAT) . . . . . . 103
9.2  Spreadsheet files (.XLS,.WKS,.WK1) . . . . . . 104
9.3  Data by variable and data by observation (.DAT) . . . . . . 106
9.4  Data with load info (.DAT) . . . . . . 106
9.5  Gauss data file (.DHT/.DAT) . . . . . . 107
9.6  Stata data file (.dta) . . . . . . 107
9.7  Results file (.OUT) . . . . . . 107
9.8  Batch file (.FL) . . . . . . 107
9.9  Algebra file (.ALG) . . . . . . 108
9.10  Ox file (.ox) . . . . . . 108
9.11  TSP file (.tsp) . . . . . . 108
9.12  Matrix file (.MAT) . . . . . . 108
9.13  GiveWin graphics file (.GWG) . . . . . . 108
9.14  PostScript file (.EPS) . . . . . . 110
9.15  PostScript file (.PS) . . . . . . 113
9.16  Enhanced meta file (.EMF) . . . . . . 113
9.17  Windows meta file (.WMF) . . . . . . 113
Chapter  10 Algebra Language . . . . . . 114
10.1  Introduction . . . . . . 114
10.2  Executing Algebra code . . . . . . 114
10.2.1  Calculator (Alt+c) . . . . . . 114
10.2.2  Algebra Editor (Alt+a) . . . . . . 115
10.2.3  Algebra from Results windows (Ctrl+a) . . . . . . 115
10.2.4  Algebra from a Batch file . . . . . . 115
10.3  Syntax of Algebra language . . . . . . 115
10.3.1  Variables and variable names . . . . . . 115
10.3.2  Comment . . . . . . 115
10.3.3  Constants . . . . . . 116
10.3.4  Algebra operators . . . . . . 116
  10.3.4.1 Arithmetic operators . . . . . . 116
  10.3.4.2 Relational and logical operators . . . . . . 116
  10.3.4.3 Algebra operator precedence . . . . . . 116
10.3.5  Assignment statements . . . . . . 116
10.3.6  Conditional assignment statements . . . . . . 117
10.3.7  Indexing . . . . . . 118
10.3.8  Keywords . . . . . . 119
10.4  Algebra Functions . . . . . . 119
10.4.1  Differencing and lag functions . . . . . . 119
10.4.2  ACF and periodogram functions . . . . . . 120
10.4.3  Sorting functions . . . . . . 120
10.4.4  Smoothing functions . . . . . . 122
  10.4.4.1 Hodrick--Prescott filter . . . . . . 122
  10.4.4.2 Kernel and spline smoothing . . . . . . 122
10.4.5  Algebra function list . . . . . . 123
Chapter  11 Batch Language . . . . . . 125
11.1  Introduction . . . . . . 125
11.2  Executing Batch commands . . . . . . 125
11.2.1  Batch Editor (Alt+b) . . . . . . 125
11.2.2  Batch from Results windows (Ctrl+b) . . . . . . 125
11.2.3  Batch from the File/Open command . . . . . . 126
11.2.4  Batch from the Windows Explorer . . . . . . 126
11.2.5  Batch from a Batch file . . . . . . 126
11.3  Batch files and default folders . . . . . . 126
11.4  Batch command summary . . . . . . 126
11.4.1  Comment . . . . . . 126
11.4.2  Command types . . . . . . 126
11.4.3  Default arguments . . . . . . 127
11.5  Batch commands . . . . . . 127
11.5.1  algebra . . . . . . 128
11.5.2  appenddata . . . . . . 128
11.5.3  appresults . . . . . . 128
11.5.4  break . . . . . . 128
11.5.5  chdir . . . . . . 128
11.5.6  closedata . . . . . . 129
11.5.7  command . . . . . . 129
11.5.8  database . . . . . . 129
11.5.9  draw . . . . . . 129
11.5.10  drawf . . . . . . 129
11.5.11  drawx . . . . . . 130
11.5.12  drawz . . . . . . 130
11.5.13  exit; . . . . . . 131
11.5.14  loadalgebra . . . . . . 131
11.5.15  loadbatch . . . . . . 131
11.5.16  loadcommand . . . . . . 131
11.5.17  loaddata . . . . . . 131
11.5.18  loadgraph . . . . . . 131
11.5.19  module . . . . . . 131
11.5.20  print . . . . . . 132
11.5.21  println . . . . . . 132
11.5.22  savedata . . . . . . 132
11.5.23  savedrawwindow . . . . . . 132
11.5.24  saveresults . . . . . . 132
11.5.25  setdraw . . . . . . 132
11.5.26  setdrawwindow . . . . . . 134
11.5.27  show . . . . . . 134
11.5.28  usedata . . . . . . 134
11.6  Examples . . . . . . 134
Chapter  12 GiveWin graphics . . . . . . 137
12.1  Graphics paper . . . . . . 137
12.2  Creating graphs . . . . . . 138
12.3  Printing graphs . . . . . . 138
12.4  Graphics formats . . . . . . 139
12.5  Saving and loading graphs . . . . . . 139
12.6  Graphics objects . . . . . . 139
12.6.1  Area . . . . . . 139
12.6.2  Line attributes . . . . . . 140
12.6.3  Regression, Scale . . . . . . 141
12.6.4  Axes . . . . . . 142
12.6.5  Legends . . . . . . 143
12.6.6  Histogram . . . . . . 143
12.6.7  Paper colour . . . . . . 143
12.6.8  Text . . . . . . 144
12.6.9  Lines . . . . . . 144
12.6.10  Adding, moving and deleting objects . . . . . . 144
12.6.11  Grid . . . . . . 144
12.6.12  Pointing . . . . . . 144
12.6.13  Graphics setup . . . . . . 144
12.7  Copy and paste . . . . . . 145
12.8  Graphics view size . . . . . . 145
12.9  Change graph scale . . . . . . 145
12.10  Graphics display mode . . . . . . 145
12.11  Graphs and sample selection . . . . . . 146
12.12  Text formatting . . . . . . 146
Chapter  13 GiveWin data management . . . . . . 149
13.1  Creating data . . . . . . 149
13.2  Database font . . . . . . 149
13.3  Database description . . . . . . 149
13.4  Printing data . . . . . . 149
13.5  Data formats . . . . . . 150
13.6  Print database info . . . . . . 150
13.7  Saving data . . . . . . 150
13.8  Navigation and editing . . . . . . 150
13.9  Renaming variables . . . . . . 151
13.10  Deleting variables . . . . . . 151
13.11  Reordering variables . . . . . . 151
13.12  Adding variables . . . . . . 151
13.13  Extending the sample period . . . . . . 151
13.13.1  Changing the sample period . . . . . . 151
13.14  Copy and paste . . . . . . 151
13.15  Appending data . . . . . . 152
Chapter References . . . . . . 153
Chapter Subject Index . . . . . . 155


Books

Doornik, J.A. (2001). Ox: An Object-Oriented Matrix Language, London: Timberlake Consultants Press. (ISBN 0-9533394-0-8).

Chapter List of Figures . . . . . . xxv
Chapter List of Tables . . . . . . xxvi
Chapter List of Program Listings . . . . . . xxvii
Chapter Preface . . . . . . xxix
Chapter  1 Prologue . . . . . . 1
1.1  What is Ox? . . . . . . 1
1.2  Availability . . . . . . 1
1.3  Ox version . . . . . . 1
1.4  Learning Ox . . . . . . 1
1.5  Ox platforms . . . . . . 2
1.6  Ox is fast . . . . . . 2
1.7  Ox supported data formats . . . . . . 2
1.8  Extending Ox . . . . . . 3
1.9  World Wide Web . . . . . . 3
1.10  Online documentation . . . . . . 3
1.11  Ox-users discussion list . . . . . . 3
1.12  Installation . . . . . . 4
1.13  Completing the basic installation . . . . . . 4
1.14  Directory structure . . . . . . 4
1.15  OX3PATH . . . . . . 5
1.16  Ox for Unix . . . . . . 6
PART I Introduction to Ox . . . . . . 9
Chapter  2 Getting started with Ox . . . . . . 11
2.1  Introduction . . . . . . 11
2.2  A first Ox program . . . . . . 11
2.3  Running the first Ox program . . . . . . 13
2.3.1  Ox Professional under Windows . . . . . . 13
2.3.2  Ox Console under Windows . . . . . . 13
2.3.3  Unix . . . . . . 13
2.4  Online help . . . . . . 14
2.5  Using file names in Ox . . . . . . 14
2.6  Ox file extensions . . . . . . 14
2.7  More on running Ox programs . . . . . . 14
2.7.1  Windows: GiveWin and OxRun . . . . . . 14
2.7.2  Windows: command-line compiler . . . . . . 15
2.7.3  Unix compiler . . . . . . 15
2.7.4  Running programs with graphics . . . . . . 15
2.7.5  Compilation into .oxo file . . . . . . 16
2.7.6  The debugger . . . . . . 16
2.7.7  OxEdit . . . . . . 16
2.7.8  Windows context menu . . . . . . 16
2.8  Command line arguments . . . . . . 16
2.8.1  General switches . . . . . . 17
2.8.2  Optimization switches . . . . . . 17
2.8.3  Run-time switches . . . . . . 18
2.9  Extending Ox . . . . . . 18
Chapter  3 Introduction to the Ox language . . . . . . 19
3.1  Variables, types and scope . . . . . . 19
3.2  Indexing matrices . . . . . . 20
3.3  Functions and function arguments . . . . . . 21
3.4  The for and while loops . . . . . . 23
3.5  The if statement . . . . . . 24
3.6  Operations and matrix programming . . . . . . 26
3.7  Arrays . . . . . . 28
3.8  Multiple files . . . . . . 29
3.8.1  Including the code into the main file . . . . . . 30
3.8.2  Separate compilation and linkage . . . . . . 30
3.8.3  Separate compilation, using import . . . . . . 31
3.9  Object-oriented programming . . . . . . 31
3.10  Style and Hungarian notation . . . . . . 32
3.11  Optimizing for speed . . . . . . 34
Chapter  4 Numerical accuracy . . . . . . 35
Chapter  5 How to ... . . . . . . 41
Chapter  6 Some matrix algebra . . . . . . 45
PART II Function and Language Reference . . . . . . 51
Chapter  7 Function summary . . . . . . 53
Chapter  8 Function reference . . . . . . 63
acf . . . . . . 64
acos . . . . . . 65
aggregatec . . . . . . 66
aggregater . . . . . . 66
any . . . . . . 67
arglist . . . . . . 67
array . . . . . . 68
asin . . . . . . 69
atan . . . . . . 69
atan2 . . . . . . 69
bessel . . . . . . 69
betafunc . . . . . . 70
binand . . . . . . 71
bincomp . . . . . . 71
binor . . . . . . 71
cabs . . . . . . 71
cdiv . . . . . . 71
cerf . . . . . . 71
cexp . . . . . . 71
clog . . . . . . 71
cmul . . . . . . 71
csqrt . . . . . . 71
ceil . . . . . . 73
chdir . . . . . . 74
choleski . . . . . . 74
columns . . . . . . 75
constant . . . . . . 76
correlation . . . . . . 76
cos . . . . . . 77
cosh . . . . . . 77
countc . . . . . . 78
countr . . . . . . 79
cumprod . . . . . . 79
cumsum . . . . . . 80
cumulate . . . . . . 81
date . . . . . . 82
dawson . . . . . . 83
dayofcalender . . . . . . 83
dayofweek . . . . . . 83
decldl . . . . . . 84
decldlband . . . . . . 85
declu . . . . . . 87
decqr . . . . . . 88
decqrmul . . . . . . 90
decsvd . . . . . . 91
deletec . . . . . . 93
deleter . . . . . . 93
deleteifc . . . . . . 93
deleteifr . . . . . . 93
denschi . . . . . . 94
densf . . . . . . 94
densn . . . . . . 94
denst . . . . . . 94
determinant . . . . . . 95
dfft . . . . . . 95
diag . . . . . . 96
diagcat . . . . . . 97
diagonal . . . . . . 97
diagonalize . . . . . . 98
diff0 . . . . . . 99
discretize . . . . . . 100
double . . . . . . 101
dropc . . . . . . 101
dropr . . . . . . 101
eigen . . . . . . 102
eigensym . . . . . . 102
eigensymgen . . . . . . 103
eprint . . . . . . 104
erf . . . . . . 105
exclusion . . . . . . 105
exit . . . . . . 106
exp . . . . . . 106
expint . . . . . . 106
fabs . . . . . . 107
fclose . . . . . . 107
feof . . . . . . 107
fflush . . . . . . 107
fft . . . . . . 108
floor . . . . . . 108
fmod . . . . . . 109
fopen . . . . . . 109
format . . . . . . 110
fprint . . . . . . 111
fprintln . . . . . . 111
fread . . . . . . 112
fremove . . . . . . 114
fscan . . . . . . 114
fseek . . . . . . 117
fsize . . . . . . 118
fwrite . . . . . . 118
fuzziness . . . . . . 120
gammafact . . . . . . 120
gammafunc . . . . . . 121
getcwd . . . . . . 122
getenv . . . . . . 122
idiv . . . . . . 122
imod . . . . . . 122
insertc . . . . . . 123
insertr . . . . . . 123
int . . . . . . 123
intersection . . . . . . 123
invert . . . . . . 124
inverteps . . . . . . 125
invertgen . . . . . . 125
invertsym . . . . . . 127
isarray . . . . . . 127
isclass . . . . . . 127
isdouble . . . . . . 127
isfile . . . . . . 127
isfunction . . . . . . 127
isint . . . . . . 127
ismatrix . . . . . . 127
isstring . . . . . . 127
isdotfeq . . . . . . 128
isfeq . . . . . . 128
isdotinf . . . . . . 129
isdotnan . . . . . . 129
isnan . . . . . . 129
lag0 . . . . . . 130
limits . . . . . . 131
loadmat . . . . . . 132
log . . . . . . 134
log10 . . . . . . 134
logdet . . . . . . 134
loggamma . . . . . . 135
lower . . . . . . 136
matrix . . . . . . 136
max . . . . . . 137
maxc . . . . . . 137
maxcindex . . . . . . 137
meanc . . . . . . 138
meanr . . . . . . 138
min . . . . . . 138
minc . . . . . . 138
mincindex . . . . . . 138
norm . . . . . . 139
nullspace . . . . . . 140
ols2c . . . . . . 141
ols2r . . . . . . 141
olsc . . . . . . 141
olsr . . . . . . 141
ones . . . . . . 142
outer . . . . . . 143
oxfilename . . . . . . 144
oxrunerror . . . . . . 144
oxversion . . . . . . 145
oxwarning . . . . . . 145
periodogram . . . . . . 146
polydiv . . . . . . 148
polygamma . . . . . . 149
polymake . . . . . . 150
polymul . . . . . . 151
polyroots . . . . . . 152
pow . . . . . . 153
print . . . . . . 154
println . . . . . . 154
probchi . . . . . . 156
probf . . . . . . 156
probn . . . . . . 156
probt . . . . . . 156
prodc . . . . . . 158
prodr . . . . . . 158
quanchi . . . . . . 158
quanf . . . . . . 158
quann . . . . . . 158
quant . . . . . . 158
quantilec . . . . . . 160
quantiler . . . . . . 160
range . . . . . . 161
rank . . . . . . 162
rann . . . . . . 163
ranseed . . . . . . 164
ranu . . . . . . 165
reflect . . . . . . 166
reshape . . . . . . 166
reversec . . . . . . 167
reverser . . . . . . 167
round . . . . . . 168
rows . . . . . . 168
savemat . . . . . . 169
scan . . . . . . 170
selectc . . . . . . 171
selectr . . . . . . 171
selectifc . . . . . . 171
selectifr . . . . . . 171
selectrc . . . . . . 171
setbounds . . . . . . 173
setdiagonal . . . . . . 173
setlower . . . . . . 173
setupper . . . . . . 173
shape . . . . . . 175
sin . . . . . . 175
sinh . . . . . . 175
sizec . . . . . . 176
sizeof . . . . . . 176
sizer . . . . . . 176
sizerc . . . . . . 176
solveldl . . . . . . 177
solveldlband . . . . . . 177
solvelu . . . . . . 178
solvetoeplitz . . . . . . 178
sortbyc . . . . . . 179
sortbyr . . . . . . 179
sortc . . . . . . 180
sortcindex . . . . . . 180
sortr . . . . . . 180
spline . . . . . . 182
sprint . . . . . . 184
sprintbuffer . . . . . . 184
sqr . . . . . . 185
sqrt . . . . . . 185
sscan . . . . . . 186
standardize . . . . . . 187
string . . . . . . 187
strfind . . . . . . 188
strfindr . . . . . . 188
strifind . . . . . . 188
strifindr . . . . . . 188
strlwr . . . . . . 189
strupr . . . . . . 189
submat . . . . . . 189
sumc . . . . . . 190
sumr . . . . . . 190
sumsqrc . . . . . . 190
sumsqrr . . . . . . 190
systemcall . . . . . . 191
tailchi . . . . . . 191
tailf . . . . . . 191
tailn . . . . . . 191
tailt . . . . . . 191
tan . . . . . . 192
tanh . . . . . . 192
thinc . . . . . . 192
thinr . . . . . . 192
time . . . . . . 193
timer . . . . . . 194
timespan . . . . . . 194
timestr . . . . . . 194
timing . . . . . . 194
today . . . . . . 194
toeplitz . . . . . . 196
trace . . . . . . 196
trunc . . . . . . 197
truncf . . . . . . 197
unique . . . . . . 197
unit . . . . . . 198
unvech . . . . . . 198
upper . . . . . . 198
va_arglist . . . . . . 199
varc . . . . . . 199
varr . . . . . . 199
variance . . . . . . 200
vec . . . . . . 201
vech . . . . . . 202
vecindex . . . . . . 202
vecr . . . . . . 203
vecrindex . . . . . . 204
zeros . . . . . . 205
Chapter  9 Predefined Constants . . . . . . 206
9.1  Missing values (NaN) . . . . . . 207
9.2  Infinity . . . . . . 207
Chapter  10 Graphics function reference . . . . . . 208
10.1  Introduction . . . . . . 208
10.2  Symbol and line types . . . . . . 211
10.3  Function reference . . . . . . 213
CloseDrawWindow . . . . . . 213
Draw . . . . . . 213
DrawAdjust . . . . . . 213
DrawAxis . . . . . . 218
DrawAxisAuto . . . . . . 218
DrawBoxPlot . . . . . . 218
DrawAcf . . . . . . 219
DrawCorrelogram . . . . . . 220
DrawDensity . . . . . . 221
DrawHistogram . . . . . . 222
DrawLegend . . . . . . 223
DrawLine . . . . . . 223
DrawMatrix . . . . . . 224
DrawPLine . . . . . . 224
DrawPSymbol . . . . . . 224
DrawPText . . . . . . 224
DrawQQ . . . . . . 225
DrawSpectrum . . . . . . 225
DrawSymbol . . . . . . 227
DrawT . . . . . . 227
DrawText . . . . . . 228
DrawTitle . . . . . . 228
DrawTMatrix . . . . . . 229
DrawX . . . . . . 229
DrawXMatrix . . . . . . 230
DrawXYZ . . . . . . 230
DrawZ . . . . . . 232
SaveDrawWindow . . . . . . 233
SetDraw . . . . . . 234
SetDrawWindow . . . . . . 236
SetTextWindow . . . . . . 236
ShowDrawWindow . . . . . . 236
Chapter  11 Packages . . . . . . 237
11.1  Arma package . . . . . . 238
arma0 . . . . . . 238
armaforc . . . . . . 239
armagen . . . . . . 240
armavar . . . . . . 242
diffpow . . . . . . 243
modelforc . . . . . . 244
pacf . . . . . . 245
11.2  Maximization package . . . . . . 248
GetMaxControl . . . . . . 248
GetMaxControlEps . . . . . . 248
MaxBFGS . . . . . . 248
MaxControl . . . . . . 253
MaxControlEps . . . . . . 253
MaxConvergenceMsg . . . . . . 253
MaxFSQP . . . . . . 254
MaxNewton . . . . . . 254
MaxSimplex . . . . . . 257
Num1Derivative . . . . . . 260
Num2Derivative . . . . . . 260
NumJacobian . . . . . . 262
SolveQP . . . . . . 263
11.3  Probability package . . . . . . 266
densbeta . . . . . . 266
densgamma . . . . . . 266
densgh . . . . . . 266
densgig . . . . . . 266
denskernel . . . . . . 266
densmises . . . . . . 266
denspoisson . . . . . . 266
probbeta . . . . . . 268
probbvn . . . . . . 268
probgamma . . . . . . 268
probmises . . . . . . 268
probmvn . . . . . . 268
probpoisson . . . . . . 268
quanbeta . . . . . . 270
quangamma . . . . . . 270
quanmises . . . . . . 270
ranbeta . . . . . . 272
ranbinomial . . . . . . 272
ranbrownianmotion . . . . . . 272
ranchi . . . . . . 272
randirichlet . . . . . . 272
ranexp . . . . . . 272
ranf . . . . . . 272
rangamma . . . . . . 272
rangh . . . . . . 272
rangig . . . . . . 272
raninvgaussian . . . . . . 272
ranlogarithmic . . . . . . 272
ranlogistic . . . . . . 272
ranlogn . . . . . . 272
ranmises . . . . . . 272
ranmultinomial . . . . . . 272
rannegbin . . . . . . 272
ranpoisson . . . . . . 272
ranpoissonprocess . . . . . . 272
ranshuffle . . . . . . 272
ranstable . . . . . . 272
ransubsample . . . . . . 272
rant . . . . . . 272
ranuorder . . . . . . 272
ranwishart . . . . . . 272
11.4  QuadPack . . . . . . 276
11.5  Additional packages . . . . . . 279
11.5.1  Arfima package . . . . . . 279
11.5.2  DPD package . . . . . . 279
11.5.3  Eispack Package . . . . . . 279
11.5.4  EmmPack . . . . . . 279
11.5.5  Financial Numerical Recipes . . . . . . 279
11.5.6  G@RCH . . . . . . 280
11.5.7  GnuDraw Package . . . . . . 280
11.5.8  Lapack Package . . . . . . 280
11.5.9  Loess Package . . . . . . 280
11.5.10  MSVAR Package . . . . . . 280
11.5.11  PcNaive . . . . . . 281
11.5.12  Quantile regression . . . . . . 281
11.5.13  SSFPack . . . . . . 281
11.5.14  SVPack . . . . . . 281
Chapter  12 Class reference . . . . . . 282
12.1  Database and Sample class . . . . . . 283
12.1.1  Introduction . . . . . . 283
12.1.2  Database and Sample overview . . . . . . 285
12.1.3  Database and Sample function members . . . . . . 287
Database::Append . . . . . . 287
Database::Create . . . . . . 288
Database::Database . . . . . . 288
Database::DeSelect . . . . . . 288
Database::DeSelectByIndex . . . . . . 288
Database::DeSelectByName . . . . . . 288
Database::Deterministic . . . . . . 289
Database::FindSelection . . . . . . 289
Database::ForceSelSample . . . . . . 289
Database::GetAll . . . . . . 290
Database::GetAllNames . . . . . . 290
Sample::GetFrequency . . . . . . 290
Database::GetGroup . . . . . . 290
Database::GetGroupLag . . . . . . 290
Database::GetGroupLagNames . . . . . . 290
Database::GetGroupNames . . . . . . 290
Sample::GetIndex . . . . . . 291
Database::GetMaxGroupLag . . . . . . 291
Database::GetMaxSelLag . . . . . . 291
Sample::GetPeriod1 . . . . . . 291
Sample::GetPeriod2 . . . . . . 291
Sample::GetSize . . . . . . 291
Database::GetSelEnd . . . . . . 292
Database::GetSelStart . . . . . . 292
Database::GetSelInfo . . . . . . 292
Database::GetSelSample . . . . . . 292
Database::GetVar . . . . . . 292
Database::GetVarByIndex . . . . . . 292
Database::GetVarIndex . . . . . . 293
Database::GetVarNameByIndex . . . . . . 293
Sample::GetYear1 . . . . . . 293
Sample::GetYear2 . . . . . . 293
Database::Grow . . . . . . 293
Database::Info . . . . . . 293
Database::Load . . . . . . 294
Database::LoadDht . . . . . . 294
Database::LoadDta . . . . . . 294
Database::LoadFmtVar . . . . . . 294
Database::LoadIn7 . . . . . . 294
Database::LoadObs . . . . . . 295
Database::LoadVar . . . . . . 295
Database::LoadWks . . . . . . 296
Database::LoadXls . . . . . . 296
Sample::ObsPeriod . . . . . . 297
Sample::ObsYear . . . . . . 297
Database::Remove . . . . . . 298
Database::RemoveObsIf . . . . . . 298
Database::Rename . . . . . . 298
Database::Renew . . . . . . 298
Database::RenewBlock . . . . . . 298
Database::SaveFmtVar . . . . . . 299
Database::SaveIn7 . . . . . . 299
Database::SaveObs . . . . . . 299
Database::SaveVar . . . . . . 299
Database::SaveWks . . . . . . 299
Database::SaveXls . . . . . . 299
Database::Select . . . . . . 300
Database::SelectByIndex . . . . . . 300
Database::SetSelInfo . . . . . . 300
Database::SetSelSample . . . . . . 301
12.2  Modelbase class . . . . . . 302
12.2.1  Introduction . . . . . . 302
12.2.2  Modelbase overview . . . . . . 304
12.2.3  Modelbase function members . . . . . . 306
Modelbase::ClearEstimation . . . . . . 306
Modelbase::ClearModel . . . . . . 306
Modelbase::Covar . . . . . . 306
Modelbase::DoEstimation . . . . . . 306
Modelbase::Estimate . . . . . . 306
Modelbase::FixPar . . . . . . 308
Modelbase::FreePar . . . . . . 308
Modelbase::GetDbName . . . . . . 308
Modelbase::GetcDfLoss . . . . . . 308
Modelbase::GetcT . . . . . . 308
Modelbase::GetCovar . . . . . . 309
Modelbase::GetCovarRobust . . . . . . 309
Modelbase::GetFreePar . . . . . . 309
Modelbase::GetFreeParCount . . . . . . 309
Modelbase::GetFreeParNames . . . . . . 309
Modelbase::GetLogLik . . . . . . 309
Modelbase::GetMethod . . . . . . 309
Modelbase::GetModelStatus . . . . . . 310
Modelbase::GetPackageName . . . . . . 310
Modelbase::GetPackageVersion . . . . . . 310
Modelbase::GetPar . . . . . . 310
Modelbase::GetParCount . . . . . . 310
Modelbase::GetParNames . . . . . . 310
Modelbase::GetParStatus . . . . . . 311
Modelbase::GetResiduals . . . . . . 311
Modelbase::GetResult . . . . . . 311
Modelbase::GetResVar . . . . . . 311
Modelbase::GetStdErr . . . . . . 312
Modelbase::GetStdErrRobust . . . . . . 312
Modelbase::InitData . . . . . . 312
Modelbase::InitPar . . . . . . 312
Modelbase::IsUnivariate . . . . . . 312
Modelbase::MapParToFree . . . . . . 313
Modelbase::Modelbase . . . . . . 313
Modelbase::Output . . . . . . 313
Modelbase::OutputHeader . . . . . . 313
Modelbase::OutputLogLik . . . . . . 313
Modelbase::OutputMax . . . . . . 314
Modelbase::OutputPar . . . . . . 314
Modelbase::PrintTestVal . . . . . . 314
Modelbase::ResetFixedPar . . . . . . 314
Modelbase::SetDbName . . . . . . 315
Modelbase::SetFreePar . . . . . . 315
Modelbase::SetMethod . . . . . . 315
Modelbase::SetModelStatus . . . . . . 315
Modelbase::SetPar . . . . . . 315
Modelbase::SetParCount . . . . . . 315
Modelbase::SetPrint . . . . . . 316
Modelbase::SetResult . . . . . . 316
Modelbase::SetStartPar . . . . . . 316
Modelbase::TestRestrictions . . . . . . 316
12.3  PcFiml class . . . . . . 318
PcFiml function members . . . . . . 322
12.4  PcFimlDgp class . . . . . . 324
PcFimlDgp::Asymp . . . . . . 326
PcFimlDgp::Create . . . . . . 326
PcFimlDgp::DiscardZ . . . . . . 326
PcFimlDgp::GenerateTo . . . . . . 326
PcFimlDgp::GenerateU . . . . . . 327
PcFimlDgp::GenerateV . . . . . . 327
PcFimlDgp::GenerateY . . . . . . 327
PcFimlDgp::GenerateZ . . . . . . 327
PcFimlDgp::GenerateU_t . . . . . . 327
PcFimlDgp::GenerateV_t . . . . . . 327
PcFimlDgp::GenerateY_t . . . . . . 327
PcFimlDgp::GenerateZ_t . . . . . . 327
PcFimlDgp::GetU . . . . . . 328
PcFimlDgp::GetV . . . . . . 328
PcFimlDgp::GetY . . . . . . 328
PcFimlDgp::GetZ . . . . . . 328
PcFimlDgp::PcFimlDgp . . . . . . 328
PcFimlDgp::Prepare . . . . . . 328
PcFimlDgp::Print . . . . . . 328
PcFimlDgp::SetDistribution . . . . . . 328
PcFimlDgp::SetFixedZ . . . . . . 329
PcFimlDgp::SetInit . . . . . . 329
PcFimlDgp::SetU . . . . . . 329
PcFimlDgp::SetV . . . . . . 329
PcFimlDgp::SetY . . . . . . 329
PcFimlDgp::SetZ . . . . . . 329
PcFimlDgp::SetYParameter . . . . . . 329
PcFimlDgp::SetZParameter . . . . . . 330
PcFimlDgp::UseObsLoop . . . . . . 330
12.5  PcNaiveDgp class . . . . . . 331
PcNaiveDgp::Asymp . . . . . . 333
PcNaiveDgp::DiscardZ . . . . . . 333
PcNaiveDgp::Generate . . . . . . 333
PcNaiveDgp::GenerateTo . . . . . . 333
PcNaiveDgp::GenerateBreakTo . . . . . . 333
PcNaiveDgp::GetU . . . . . . 334
PcNaiveDgp::GetY . . . . . . 334
PcNaiveDgp::GetZ . . . . . . 334
PcNaiveDgp::PcNaiveDgp . . . . . . 334
PcNaiveDgp::Print . . . . . . 334
PcNaiveDgp::SetDistribution . . . . . . 334
PcNaiveDgp::SetFixedZ . . . . . . 335
PcNaiveDgp::SetInit . . . . . . 335
PcNaiveDgp::SetUParameter . . . . . . 336
PcNaiveDgp::SetYParameter . . . . . . 336
PcNaiveDgp::SetYParameterEcm . . . . . . 336
PcNaiveDgp::SetZParameter . . . . . . 337
PcNaiveDgp::SetZCustom . . . . . . 337
12.6  RanMC class . . . . . . 338
RanMC::Choleski . . . . . . 338
RanMC::CheckDist . . . . . . 338
RanMC::RanDist . . . . . . 338
RanMC::RanDist1 . . . . . . 339
RanMC::WriteDist . . . . . . 339
12.7  Simulation class . . . . . . 340
Simulation::Generate . . . . . . 343
Simulation::GetCoefficients . . . . . . 343
Simulation::GetPvalues . . . . . . 343
Simulation::GetTestStatistics . . . . . . 343
Simulation::IsTwoSided . . . . . . 344
Simulation::Plot . . . . . . 344
Simulation::SaveIn7 . . . . . . 344
Simulation::SaveRecIn7 . . . . . . 344
Simulation::SetCoefNames . . . . . . 344
Simulation::SetTestNames . . . . . . 344
Simulation::SetPlotRep . . . . . . 345
Simulation::SetRecursive . . . . . . 345
Simulation::SetStore . . . . . . 345
Simulation::Simulate . . . . . . 345
Simulation::Simulation . . . . . . 345
Chapter  13 Language reference . . . . . . 346
13.1  Introduction . . . . . . 346
13.2  Lexical conventions . . . . . . 347
13.2.1  Tokens . . . . . . 347
13.2.2  Comment . . . . . . 347
13.3  Identifiers . . . . . . 347
13.3.1  Keywords . . . . . . 347
13.3.2  Constants . . . . . . 348
  13.3.2.1Integer constants . . . . . . 348
  13.3.2.2Character constants . . . . . . 348
  13.3.2.3Double constants . . . . . . 348
  13.3.2.4Matrix constants . . . . . . 349
  13.3.2.5String constants . . . . . . 350
  13.3.2.6Array constants . . . . . . 350
13.4  Objects . . . . . . 351
13.4.1  Types . . . . . . 351
  13.4.1.1Type conversion . . . . . . 351
13.4.2  Lvalue . . . . . . 352
13.4.3  Scope . . . . . . 352
13.5  External declarations . . . . . . 352
13.5.1  Enumerations . . . . . . 352
13.5.2  Specifiers . . . . . . 353
13.5.3  External variable declarations . . . . . . 353
13.5.4  Function declarations . . . . . . 354
13.5.5  Function definitions . . . . . . 355
  13.5.5.1Returning a value . . . . . . 356
  13.5.5.2Variable length argument list . . . . . . 356
  13.5.5.3Inline function definitions . . . . . . 356
13.5.6  Classes . . . . . . 356
13.5.7  Member function definitions . . . . . . 357
  13.5.7.1Constructor and destructor functions . . . . . . 358
  13.5.7.2The this reference and member scope . . . . . . 359
  13.5.7.3Static members . . . . . . 359
  13.5.7.4Derived classes . . . . . . 360
  13.5.7.5Virtual functions . . . . . . 361
13.6  Namespace . . . . . . 362
13.7  Statements . . . . . . 363
13.7.1  Selection statements . . . . . . 364
13.7.2  Iteration statements . . . . . . 364
13.7.3  Jump statements . . . . . . 365
13.7.4  Declaration statements . . . . . . 366
13.8  Expressions . . . . . . 367
13.8.1  Primary expressions . . . . . . 368
  13.8.1.1 Multiple assignment . . . . . . 369
13.8.2  Postfix expressions . . . . . . 371
  13.8.2.1 Member reference . . . . . . 371
  13.8.2.2 Function calls . . . . . . 371
  13.8.2.3 Explicit type conversion . . . . . . 372
  13.8.2.4 Indexing vector and array types . . . . . . 372
  13.8.2.5 Postfix incrementation . . . . . . 374
  13.8.2.6 Transpose . . . . . . 374
13.8.3  Power expressions . . . . . . 374
13.8.4  Unary expressions . . . . . . 376
  13.8.4.1 Prefix incrementation . . . . . . 376
  13.8.4.2 Unary minus and plus . . . . . . 376
  13.8.4.3 Logical negation . . . . . . 376
  13.8.4.4 Address operator . . . . . . 377
  13.8.4.5 New and delete . . . . . . 377
13.8.5  Multiplicative expressions . . . . . . 378
  13.8.5.1 Generalized inverse . . . . . . 380
13.8.6  Additive expressions . . . . . . 380
13.8.7  Concatenation expressions . . . . . . 381
13.8.8  Relational expressions . . . . . . 382
13.8.9  Equality expressions . . . . . . 383
13.8.10  Logical dot-AND expressions . . . . . . 385
13.8.11  Logical-AND expressions . . . . . . 385
13.8.12  Logical dot-OR expressions . . . . . . 385
13.8.13  Logical-OR expressions . . . . . . 386
13.8.14  Conditional expression . . . . . . 386
13.8.15  Assignment expressions . . . . . . 387
13.8.16  Comma expression . . . . . . 387
13.8.17  Constant expressions . . . . . . 388
13.9  Preprocessing . . . . . . 388
13.9.1  File inclusion . . . . . . 388
13.9.2  Using file names in Ox . . . . . . 389
13.9.3  Import of modules . . . . . . 389
13.9.4  Conditional compilation . . . . . . 390
13.9.5  Pragmas . . . . . . 391
13.10  Difference with ANSI C and C++ . . . . . . 391
Chapter References . . . . . . 393
Chapter Subject Index . . . . . . 397
Ox™ Appendix
Chapter  A1 Extending Ox . . . . . . 1
A1.1  Introduction . . . . . . 1
A1.2  Adding C/C++ code: a simple dynamic link library . . . . . . 2
A1.2.1  Dynamic link library and search paths . . . . . . 5
A1.3  Dynamic link libraries on Unix platforms . . . . . . 5
A1.4  Adding C/C++ code: returning values in arguments . . . . . . 6
A1.5  Calling Ox-coded functions from C . . . . . . 8
A1.6  Adding a user-friendly interface with Visual C++ . . . . . . 10
A1.7  Adding a user-friendly interface with Visual Basic . . . . . . 16
A1.7.1  Calling the Ox DLL from Visual Basic . . . . . . 16
A1.7.2  The RanApp example in Visual Basic . . . . . . 18
A1.8  Linking Fortran code . . . . . . 20
A1.9  Ox function summary . . . . . . 21
A1.10  Macros to access OxVALUEs . . . . . . 36
A1.11  Ox exported mathematics functions . . . . . . 38
A1.11.1  MATRIX and VECTOR types . . . . . . 38
A1.11.2  Exported matrix functions . . . . . . 40
A1.11.3  Matrix function reference . . . . . . 44
Chapter  A2 Modelbase and OxPack . . . . . . 66
OxPackDialog . . . . . . 69
OxPackGetData . . . . . . 70
Modelbase::ReceiveData . . . . . . 70
Modelbase::ReceiveDialog . . . . . . 71
Modelbase::ReceiveModel . . . . . . 71
Modelbase::SendDialog . . . . . . 72
Modelbase::SendFunctions . . . . . . 72
Modelbase::SendMenu . . . . . . 73
Modelbase::SendMethods . . . . . . 74
Modelbase::SendResults . . . . . . 74
Modelbase::SendSpecials . . . . . . 74
Modelbase::SendVarStatus . . . . . . 74
A2.1  Adding support for a Batch language . . . . . . 75
Modelbase::Batch . . . . . . 75
Modelbase::BatchMethod . . . . . . 76
Modelbase::BatchVarStatus . . . . . . 77
Modelbase::GetBatchModelSettings . . . . . . 77
Chapter  A3 Using OxGauss . . . . . . 78
A3.1  Introduction . . . . . . 78
A3.2  Running OxGauss programs from the command line . . . . . . 78
A3.3  Running OxGauss programs from GiveWin . . . . . . 79
A3.4  Calling OxGauss from Ox . . . . . . 79
A3.5  How does it work? . . . . . . 80
A3.6  Some large projects . . . . . . 80
A3.6.1  DPD98 for Gauss . . . . . . 81
Rename file . . . . . . 81
Fix for OxGauss syntax . . . . . . 81
Convert data files . . . . . . 81
Running the program . . . . . . 81
A3.6.2  BACC2001 . . . . . . 82
Installation . . . . . . 82
Running the program . . . . . . 82
A3.7  Known limitations . . . . . . 82
Chapter  A4 OxGauss Function Summary . . . . . . 84
Chapter  A5 OxGauss Language Reference . . . . . . 107
A5.1  Lexical conventions . . . . . . 107
A5.1.1  Tokens . . . . . . 107
A5.1.2  Comment . . . . . . 107
A5.1.3  Space . . . . . . 107
A5.2  Identifiers . . . . . . 107
A5.2.1  Keywords . . . . . . 108
A5.3  Constants . . . . . . 108
A5.3.1  Integer constants . . . . . . 108
A5.3.2  Character constants* . . . . . . 108
A5.3.3  Double constants . . . . . . 108
A5.3.4  Matrix constants . . . . . . 109
A5.3.5  String constants . . . . . . 109
A5.3.6  Constant expression . . . . . . 110
A5.4  Objects . . . . . . 110
A5.4.1  Types . . . . . . 110
  A5.4.1.1 Type conversion . . . . . . 111
A5.4.2  Lvalue . . . . . . 111
A5.5  OxGauss Program . . . . . . 111
A5.6  External declarations . . . . . . 111
A5.6.1  External statement . . . . . . 112
A5.6.2  Declare statement . . . . . . 112
A5.6.3  Function (procedure, fn, keyword) definitions . . . . . . 113
A5.6.4  external-statement-list . . . . . . 115
A5.7  Statements . . . . . . 115
A5.7.1  Assignment statements . . . . . . 115
A5.7.2  Selection statements . . . . . . 116
A5.7.3  Iteration statements . . . . . . 116
A5.7.4  Call statements . . . . . . 117
A5.7.5  Jump and pop statements . . . . . . 117
A5.7.6  Command statements . . . . . . 118
  A5.7.6.1 print and format command . . . . . . 118
  A5.7.6.2 output command . . . . . . 118
A5.8  Expressions . . . . . . 118
A5.8.1  Primary expressions . . . . . . 120
A5.8.2  Postfix expressions . . . . . . 121
  A5.8.2.1 Indexing vector and array types . . . . . . 121
  A5.8.2.2 Transpose . . . . . . 122
  A5.8.2.3 Factorial . . . . . . 123
A5.8.3  Power expressions . . . . . . 123
A5.8.4  Unary expressions . . . . . . 123
A5.8.5  Multiplicative expressions . . . . . . 123
A5.8.6  Additive expressions . . . . . . 125
A5.8.7  Modulo expressions . . . . . . 125
A5.8.8  Concatenation expressions . . . . . . 125
A5.8.9  Dot-relational expressions . . . . . . 126
  A5.8.9.1 Logical dot-NOT expressions . . . . . . 126
A5.8.10  Logical dot-AND expressions . . . . . . 126
A5.8.11  Logical dot-OR expressions . . . . . . 127
A5.8.12  Logical dot-XOR expressions . . . . . . 127
A5.8.13  Logical dot-EQV expressions . . . . . . 127
A5.8.14  Relational expressions . . . . . . 127
A5.8.15  Logical-NOT expressions . . . . . . 127
A5.8.16  Logical-AND expressions . . . . . . 127
A5.8.17  Logical-OR expressions . . . . . . 128
A5.8.18  Logical-XOR expressions . . . . . . 128
A5.8.19  Logical-EQV expressions . . . . . . 128
A5.8.20  Assignment expressions* . . . . . . 128
A5.8.21  Constant expressions . . . . . . 128
A5.9  Preprocessing . . . . . . 128
A5.9.1  File inclusion . . . . . . 129
A5.9.2  Conditional compilation . . . . . . 129
A5.9.3  Constant definition . . . . . . 130
Chapter  A6 Comparing Gauss and Ox syntax . . . . . . 131
A6.1  Introduction . . . . . . 131
A6.2  Comparison . . . . . . 131
A6.2.1  Comment . . . . . . 131
A6.2.2  Program entry . . . . . . 131
A6.2.3  Case and symbol names . . . . . . 131
A6.2.4  Types . . . . . . 132
A6.2.5  Matrix indexing . . . . . . 132
A6.2.6  Arrays . . . . . . 132
A6.2.7  Declaration and constants . . . . . . 133
A6.2.8  Expressions . . . . . . 133
A6.2.9  Operators . . . . . . 134
A6.2.10  Loop statements . . . . . . 134
A6.2.11  Conditional statements . . . . . . 135
A6.2.12  Printing . . . . . . 135
A6.2.13  Functions . . . . . . 135
A6.2.14  String manipulation . . . . . . 136
A6.2.15  Input and Output . . . . . . 136
A6.3  G2Ox . . . . . . 136
Chapter  A7 Random Number Generators . . . . . . 137
A7.1  Modified Park & Miller generator . . . . . . 137
A7.2  Marsaglia's generator . . . . . . 137
A7.3  L'Ecuyer's generator . . . . . . 138
Chapter References . . . . . . 139
Chapter Subject Index . . . . . . 140


Books

Doornik, J.A. and Ooms, M. (2000). Introduction to Ox, London: Timberlake Consultants Press. (ISBN 0-9533394-1-6).

Chapter Preface . . . . . . xiii
Chapter  1 Ox Environment . . . . . . 1
1.1  Installing Ox . . . . . . 1
1.2  Ox version . . . . . . 1
1.3  Help and documentation . . . . . . 1
1.4  Running an Ox program . . . . . . 2
1.5  Redirecting output . . . . . . 3
1.6  Using GiveWin and OxRun . . . . . . 3
1.7  Using the OxEdit editor . . . . . . 5
1.8  Graphics . . . . . . 6
1.9  Compilation and run-time errors . . . . . . 6
1.10  Have you programmed before? . . . . . . 7
Chapter  2 Syntax . . . . . . 8
2.1  Introduction . . . . . . 8
2.2  Comment . . . . . . 8
2.3  Program layout . . . . . . 9
2.4  Statements . . . . . . 10
2.5  Identifiers . . . . . . 12
2.6  Style . . . . . . 12
2.7  Matrix constants . . . . . . 13
2.8  Creating a matrix . . . . . . 13
2.9  Using functions . . . . . . 15
2.9.1  Simple functions . . . . . . 15
2.9.2  Function arguments . . . . . . 15
2.9.3  Returning a value . . . . . . 16
2.9.4  Function declaration . . . . . . 18
2.9.5  Returning values in an argument . . . . . . 18
Chapter  3 Operators . . . . . . 21
3.1  Introduction . . . . . . 21
3.2  Index operators . . . . . . 21
3.3  Matrix operators . . . . . . 22
3.4  Dot operators . . . . . . 25
3.5  Relational and equality operators . . . . . . 25
3.6  Logical operators . . . . . . 26
3.7  Assignment operators . . . . . . 28
3.8  Conditional operators . . . . . . 28
3.9  And more operators . . . . . . 29
3.10  Operator precedence . . . . . . 29
Chapter  4 Input and Output . . . . . . 31
4.1  Introduction . . . . . . 31
4.2  Using paths in Ox . . . . . . 32
4.3  Using GiveWin or Excel . . . . . . 32
4.4  Matrix file (.mat) . . . . . . 32
4.5  Spreadsheet files . . . . . . 33
4.6  GiveWin/PcGive data files (.IN7/.BN7) . . . . . . 33
4.7  What about variable names? . . . . . . 34
4.8  Finding that file . . . . . . 35
Chapter  5 Program Flow and Program Design . . . . . . 36
5.1  Introduction . . . . . . 36
5.2  for loops . . . . . . 36
5.3  while loops . . . . . . 37
5.4  break and continue . . . . . . 38
5.5  Conditional statements . . . . . . 39
5.6  Vectorization . . . . . . 39
5.7  Functions as arguments . . . . . . 40
5.8  Importing code . . . . . . 43
5.9  Global variables . . . . . . 43
5.10  Program organization . . . . . . 45
5.11  Style and Hungarian notation . . . . . . 47
Chapter  6 Graphics . . . . . . 50
6.1  Introduction . . . . . . 50
6.2  Graphics output . . . . . . 50
6.3  Running programs with graphics . . . . . . 50
6.4  Example . . . . . . 51
Chapter  7 Strings, Arrays and Print Formats . . . . . . 53
7.1  Introduction . . . . . . 53
7.2  String operators . . . . . . 53
7.3  The sprint function . . . . . . 54
7.4  Escape sequence . . . . . . 54
7.5  Print formats . . . . . . 55
7.6  Arrays . . . . . . 56
7.7  Missing values . . . . . . 56
7.8  Infinity . . . . . . 58
Chapter  8 Object-Oriented Programming . . . . . . 59
8.1  Introduction . . . . . . 59
8.2  Using object oriented code . . . . . . 59
8.3  Writing object-oriented code . . . . . . 61
8.4  Inheritance . . . . . . 63
Chapter  9 Summary . . . . . . 65
9.1  Style . . . . . . 65
9.2  Functions . . . . . . 65
9.3  Efficient programming . . . . . . 65
9.4  Computational speed . . . . . . 66
Chapter  10 Using Ox Classes . . . . . . 67
10.1  Introduction . . . . . . 67
10.2  Regression example . . . . . . 68
10.3  Simulation example . . . . . . 70
10.4  MySimula class . . . . . . 73
10.4.1  The first step . . . . . . 73
10.4.2  Adding data members . . . . . . 74
10.4.3  Inheritance . . . . . . 75
10.4.4  Virtual functions . . . . . . 76
10.4.5  Last step . . . . . . 77
10.5  Conclusion . . . . . . 77
Chapter  11 Example: probit estimation . . . . . . 78
11.1  Introduction . . . . . . 78
11.2  The probit model . . . . . . 78
11.3  Step 1: estimation . . . . . . 80
11.4  Step 2: Analytical scores . . . . . . 82
11.5  Step 3: removing global variables: the Database class . . . . . . 84
11.6  Step 4: independence from the model specification . . . . . . 85
11.7  Step 5: using the Modelbase class . . . . . . 87
11.7.1  Switching to the Modelbase class . . . . . . 87
11.7.2  Splitting the source code . . . . . . 89
11.7.3  Interactive use using OxPack . . . . . . 89
11.7.4  Extending the interface . . . . . . 90
11.8  A Monte Carlo experiment . . . . . . 91
11.8.1  Extending the class . . . . . . 91
11.8.2  One replication . . . . . . 92
11.8.3  Many replications . . . . . . 93
11.9  Conclusion . . . . . . 94
Chapter  A1 A debug session . . . . . . 95
Chapter  A2 Installation Issues . . . . . . 98
A2.1  Updating the environment . . . . . . 98
A2.2  Using the OxEdit editor . . . . . . 98
Chapter References . . . . . . 101
Chapter Subject Index . . . . . . 103


Books

Hendry, D.F. and Doornik, J.A. (2001). Empirical Econometric Modelling Using PcGive™ Volume I, London: Timberlake Consultants Press. (ISBN 0-9533394-2-4)

PART I PcGive Prologue . . . . . . 1
Chapter  1 Introduction to PcGive . . . . . . 3
1.1  The PcGive system . . . . . . 3
1.2  Single equation modelling . . . . . . 4
1.3  The special features of PcGive . . . . . . 5
Advanced graphics . . . . . . 8
Efficient modelling sequence . . . . . . 8
Thorough evaluation . . . . . . 9
1.4  Documentation conventions . . . . . . 10
1.5  Using PcGive documentation . . . . . . 11
1.6  An overview of PcGive menus . . . . . . 12
1.7  Citation . . . . . . 12
1.8  World Wide Web . . . . . . 12
1.9  Some data sets . . . . . . 12
Chapter  2 Getting Started . . . . . . 13
2.1  Starting PcGive . . . . . . 13
2.2  Loading and viewing the tutorial data set . . . . . . 14
2.3  GiveWin graphics . . . . . . 16
2.3.1  A first graph . . . . . . 17
2.3.2  Graph saving and printing . . . . . . 19
PART II PcGive Tutorials . . . . . . 21
Chapter  3 Tutorial on Cross-section Regression . . . . . . 23
3.1  Setting up a regression . . . . . . 23
3.2  Cross-section regression estimation . . . . . . 26
3.2.1  Simple regression output . . . . . . 27
3.3  Regression graphics . . . . . . 30
3.4  Testing restrictions and omitted variables . . . . . . 32
3.5  Multiple regression . . . . . . 34
3.6  Formal tests . . . . . . 36
3.7  Storing residuals in the database . . . . . . 37
Chapter  4 Tutorial on Description Statistics and Unit Roots . . . . . . 38
4.1  Descriptive data analysis . . . . . . 39
4.2  Autoregressive distributed lag . . . . . . 41
4.3  Unit-root tests . . . . . . 44
Chapter  5 Tutorial on Dynamic Modelling . . . . . . 48
5.1  Model formulation . . . . . . 48
5.2  Model estimation . . . . . . 49
5.3  Model output . . . . . . 51
5.3.1  Equation estimates . . . . . . 51
5.3.2  Analysis of 1-step forecast statistics . . . . . . 52
5.4  Graphical evaluation . . . . . . 52
5.5  Dynamic analysis . . . . . . 54
5.6  Mis-specification tests . . . . . . 56
5.7  Specification tests . . . . . . 58
5.7.1  Exclusion, linear and general restrictions . . . . . . 58
5.7.2  Test for common factors . . . . . . 60
5.8  Options . . . . . . 61
5.9  Further Output . . . . . . 61
5.10  Forecasting . . . . . . 62
Chapter  6 Tutorial on Estimation Methods . . . . . . 65
6.1  Recursive estimation . . . . . . 65
6.2  Instrumental variables . . . . . . 68
6.2.1  Structural estimates . . . . . . 68
6.2.2  Reduced forms . . . . . . 69
6.3  Autoregressive least squares . . . . . . 70
6.3.1  Optimization . . . . . . 72
6.3.2  RALS model evaluation . . . . . . 74
6.4  Non-linear least squares . . . . . . 75
Chapter  7 Tutorial on Batch Usage . . . . . . 81
Chapter  8 Tutorial on Model Reduction . . . . . . 83
8.1  The problems of simple-to-general modelling . . . . . . 83
8.2  Formulating general models . . . . . . 83
8.3  Analyzing general models . . . . . . 85
8.4  Sequential simplification . . . . . . 86
8.5  Encompassing tests . . . . . . 90
8.6  Model revision . . . . . . 91
Chapter  9 Non-linear Models . . . . . . 92
9.1  Introduction . . . . . . 92
9.2  Non-linear modelling . . . . . . 92
9.3  Maximizing a function . . . . . . 93
9.4  Logit and probit estimation . . . . . . 94
9.5  Tobit estimation . . . . . . 100
9.6  ARMA estimation . . . . . . 101
9.7  ARCH estimation . . . . . . 105
PART III The Econometrics of PcGive . . . . . . 107
Chapter  10 An Overview . . . . . . 109
Chapter  11 Learning Elementary Econometrics Using PcGive . . . . . . 112
11.1  Introduction . . . . . . 112
11.2  Variation over time . . . . . . 113
11.3  Variation across a variable . . . . . . 114
11.4  Populations, samples and shapes of distributions . . . . . . 116
11.5  Correlation and scalar regression . . . . . . 117
11.6  Interdependence . . . . . . 120
11.7  Time dependence . . . . . . 121
11.8  Dummy variables . . . . . . 124
11.9  Sample variability . . . . . . 125
11.10  Collinearity . . . . . . 125
11.11  Nonsense regressions . . . . . . 128
Chapter  12 Intermediate Econometrics . . . . . . 129
12.1  Introduction . . . . . . 129
12.2  Linear dynamic equations . . . . . . 130
12.2.1  Stationarity and non-stationarity . . . . . . 130
12.2.2  Lag polynomials . . . . . . 130
  12.2.2.1 Roots of lag polynomials . . . . . . 132
  12.2.2.2 Long-run solutions . . . . . . 132
  12.2.2.3 Common factors . . . . . . 133
12.3  Cointegration . . . . . . 133
12.4  A typology of simple dynamic models . . . . . . 137
12.4.1  Static regression . . . . . . 139
12.4.2  Univariate autoregressive processes . . . . . . 140
12.4.3  Leading indicators . . . . . . 141
12.4.4  Growth-rate models . . . . . . 141
12.4.5  Distributed lags . . . . . . 142
12.4.6  Partial adjustment . . . . . . 142
12.4.7  Autoregressive errors or COMFAC models . . . . . . 143
12.4.8  Equilibrium-correction mechanisms . . . . . . 144
12.4.9  Dead-start models . . . . . . 146
12.5  Interpreting linear models . . . . . . 146
12.5.1  Interpretation 1: a regression equation . . . . . . 146
12.5.2  Interpretation 2: a (linear) least-squares approximation . . . . . . 147
12.5.3  Interpretation 3: an autonomous contingent plan . . . . . . 147
12.5.4  Interpretation 4: derived from a behavioural relationship . . . . . . 147
12.6  Multiple regression . . . . . . 148
12.6.1  Estimating partial adjustment . . . . . . 149
12.6.2  Heteroscedastic-consistent standard errors . . . . . . 150
12.6.3  Specific-to-general . . . . . . 151
12.6.4  General-to-specific . . . . . . 154
12.6.5  Time series . . . . . . 156
12.6.6  Equilibrium correction . . . . . . 156
12.6.7  Non-linear least squares, COMFAC, and RALS . . . . . . 157
12.7  Econometrics concepts . . . . . . 161
12.7.1  Innovations and white noise . . . . . . 161
12.7.2  Exogeneity . . . . . . 161
12.7.3  Constancy and invariance . . . . . . 163
12.7.4  Congruent models . . . . . . 164
12.7.5  Encompassing rival models . . . . . . 165
12.8  Instrumental variables . . . . . . 167
12.9  Inference and diagnostic testing . . . . . . 168
12.10  Model selection . . . . . . 170
12.10.1  Three levels of knowledge . . . . . . 170
12.10.2  Modelling criteria . . . . . . 171
12.10.3  Implicit model design . . . . . . 172
12.10.4  Explicit model design . . . . . . 172
Chapter  13 Statistical Theory . . . . . . 174
13.1  Introduction . . . . . . 174
13.2  Normal distribution . . . . . . 174
13.3  The bivariate normal density . . . . . . 175
13.3.1  Marginal and conditional normal distributions . . . . . . 175
13.3.2  Regression . . . . . . 176
13.4  Multivariate normal . . . . . . 177
13.4.1  Multivariate normal density . . . . . . 177
13.4.2  Multiple regression . . . . . . 178
13.4.3  Functions of normal variables: chi ^2, t and F distributions . . . . . . 179
13.5  Likelihood . . . . . . 180
13.6  Estimation . . . . . . 181
13.6.1  The score and the Hessian . . . . . . 182
13.6.2  Maximum likelihood estimation . . . . . . 183
13.6.3  Efficiency and Fisher's information . . . . . . 183
13.6.4  Cramer-Rao bound . . . . . . 184
13.6.5  Properties of Fisher's information . . . . . . 185
13.6.6  Estimating Fisher's information . . . . . . 185
13.7  Multiple regression . . . . . . 186
13.7.1  The multiple regression model . . . . . . 186
13.7.2  Ordinary least squares . . . . . . 187
13.7.3  Distributional results . . . . . . 189
13.7.4  Subsets of parameters . . . . . . 190
13.7.5  Partitioned inversion . . . . . . 192
13.7.6  Multiple correlation . . . . . . 193
13.7.7  Partial correlation . . . . . . 194
13.7.8  Maximum likelihood estimation . . . . . . 195
13.7.9  Recursive estimation . . . . . . 195
Chapter  14 Advanced Econometrics . . . . . . 197
14.1  Introduction . . . . . . 197
14.2  Dynamic systems . . . . . . 197
14.3  Data density factorizations . . . . . . 200
14.3.1  Innovations and white noise . . . . . . 200
14.3.2  Weak exogeneity . . . . . . 201
14.4  Model evaluation . . . . . . 202
14.5  An information taxonomy . . . . . . 204
14.5.1  The relative past . . . . . . 204
14.5.2  The relative present . . . . . . 205
14.5.3  The relative future . . . . . . 206
14.5.4  Theory information . . . . . . 206
14.5.5  Measurement information . . . . . . 207
14.5.6  Rival models . . . . . . 207
14.5.7  The theory of reduction . . . . . . 208
14.6  Test types . . . . . . 210
14.7  Modelling strategies . . . . . . 211
14.8  Model estimation . . . . . . 211
14.9  Conclusion . . . . . . 213
Chapter  15 Nine Important Practical Econometric Problems . . . . . . 214
15.1  Multicollinearity . . . . . . 214
15.2  Residual autocorrelation . . . . . . 216
15.3  Dynamic specification . . . . . . 216
15.4  Non-nested hypotheses . . . . . . 217
15.5  Simultaneous equations bias . . . . . . 218
15.6  Identifying restrictions . . . . . . 218
15.7  Predictive failure . . . . . . 220
15.8  Non-stationarity . . . . . . 223
15.9  Data mining . . . . . . 224
PART IV The Statistical Output of PcGive . . . . . . 227
Chapter  16 Descriptive Statistics in PcGive . . . . . . 229
16.1  Descriptive data analysis . . . . . . 229
16.1.1  Test for normality . . . . . . 229
16.1.2  Correlations . . . . . . 229
16.1.3  Unit-root tests . . . . . . 230
Chapter  17 Model Estimation Statistics . . . . . . 232
17.1  Recursive estimation: RLS/RIVE/RNLS/RML . . . . . . 233
17.2  OLS estimation . . . . . . 233
17.2.1  The estimated regression equation . . . . . . 234
17.2.2  Standard errors of the regression coefficients . . . . . . 234
17.2.3  t-values and t-probability . . . . . . 235
17.2.4  Squared partial correlations . . . . . . 235
17.2.5  Equation standard error . . . . . . 235
17.2.6  Residual sum of squares (RSS) . . . . . . 236
17.2.7  R^2: squared multiple correlation coefficient . . . . . . 236
17.2.8  F-statistic . . . . . . 236
17.2.9  Log-likelihood . . . . . . 237
17.2.10  Durbin--Watson test (DW) . . . . . . 237
17.2.11  Mean and variance of dependent variable . . . . . . 238
17.2.12  *Information criteria . . . . . . 238
17.2.13  *Heteroscedastic-consistent standard errors (HCSEs) . . . . . . 238
17.2.14  *R^2 relative to difference and seasonals . . . . . . 239
17.2.15  *Correlation matrix of regressors . . . . . . 239
17.2.16  *Covariance matrix of estimated parameters . . . . . . 239
17.2.17  1-step (ex post) forecast analysis . . . . . . 240
17.2.18  Forecast test . . . . . . 240
17.2.19  Chow test . . . . . . 241
17.2.20  t-test for zero forecast innovation mean (RLS only) . . . . . . 242
17.3  IV estimation . . . . . . 242
17.3.1  *Reduced form estimates . . . . . . 242
17.3.2  Structural estimates . . . . . . 243
17.3.3  Specification chi^2 . . . . . . 243
17.3.4  Testing beta = 0 . . . . . . 244
17.3.5  Forecast test . . . . . . 244
17.4  RALS estimation . . . . . . 244
17.4.1  Initial values for RALS . . . . . . 245
17.4.2  Final estimates . . . . . . 246
17.4.3  Analysis of 1-step forecasts . . . . . . 246
17.4.4  Forecast tests . . . . . . 247
17.5  Non-linear modelling . . . . . . 247
17.5.1  Non-linear least squares (NLS) estimation . . . . . . 247
17.5.2  Maximum likelihood (ML) estimation . . . . . . 248
17.5.3  Practical details . . . . . . 249
Chapter  18 Model Evaluation Statistics . . . . . . 252
18.1  Graphic analysis . . . . . . 252
18.2  Recursive graphics (RLS/RIVE/RNLS/RML) . . . . . . 253
18.3  Dynamic analysis . . . . . . 255
18.3.1  Static long-run solution . . . . . . 255
18.3.2  Analysis of lag structure . . . . . . 256
  18.3.2.1Tests on the significance of each variable . . . . . . 256
  18.3.2.2Tests on the significance of each lag . . . . . . 257
18.3.3  Tests on the significance of all lags . . . . . . 257
18.3.4  COMFAC tests . . . . . . 257
18.3.5  Lag weights . . . . . . 258
18.4  Diagnostic tests . . . . . . 258
18.4.1  Introduction . . . . . . 258
18.4.2  Residual correlogram and Portmanteau statistic . . . . . . 259
18.4.3  Error autocorrelation test (not for RALS, ML) . . . . . . 260
18.4.4  Normality test . . . . . . 261
18.4.5  Heteroscedasticity test using squares (not for ML) . . . . . . 262
18.4.6  Heteroscedasticity test using squares and cross-products (not for ML) . . . . . . 262
18.4.7  ARCH test . . . . . . 262
18.4.8  RESET (OLS only) . . . . . . 263
18.4.9  Parameter instability tests (OLS only) . . . . . . 263
18.4.10  Diagnostic tests for NLS . . . . . . 263
18.5  Linear restrictions test . . . . . . 263
18.6  General restrictions . . . . . . 264
18.7  Test for omitted variables (OLS) . . . . . . 264
18.8  Progress: the sequential reduction sequence . . . . . . 264
18.9  Encompassing and `non-nested' hypotheses tests . . . . . . 265
PART V Appendices . . . . . . 267
Chapter  A1 PcGive Languages . . . . . . 269
A1.1  General restrictions . . . . . . 269
A1.2  Non-linear models . . . . . . 270
A1.2.1  Non-linear least squares . . . . . . 270
A1.2.2  Maximum likelihood . . . . . . 270
A1.3  PcGive batch language . . . . . . 271
Chapter  A2 PcGive Artificial Data Set (data.in7/data.bn7) . . . . . . 276
Chapter  A3 Numerical Changes From Previous Versions . . . . . . 278
A3.1  From version 9 to 10 . . . . . . 278
A3.2  From version 8 to 9 . . . . . . 278
A3.3  From version 7 to 8 . . . . . . 278
Chapter References . . . . . . 279
Chapter Author Index . . . . . . 289
Chapter Subject Index . . . . . . 291


Books

Doornik, J.A. and Hendry, D.F. (2001). Modelling Dynamic Systems Using PcGive™ Volume II, London: Timberlake Consultants Press.

Chapter List of Figures . . . . . . xv
Chapter List of Tables . . . . . . xvii
Chapter Preface . . . . . . xix
PART I Prologue . . . . . . 1
Chapter  1 Introduction to Volume II . . . . . . 3
1.1  The PcGive system . . . . . . 3
1.2  Multiple-equation dynamic modelling . . . . . . 4
1.3  The special features . . . . . . 5
Efficient modelling sequence . . . . . . 6
Powerful evaluation . . . . . . 8
1.4  Documentation conventions . . . . . . 9
1.5  Using Volume II . . . . . . 9
1.6  An overview of PcGive menus . . . . . . 11
1.7  Citation . . . . . . 11
1.8  World Wide Web . . . . . . 11
1.9  Some data sets . . . . . . 11
PART II Tutorials on Multiple-Equation Modelling . . . . . . 13
Chapter  2 Tutorial Data . . . . . . 15
2.1  Introduction . . . . . . 15
2.2  The tutorial data set . . . . . . 15
Chapter  3 Tutorial on Unrestricted System Estimation and Evaluation . . . . . . 18
3.1  Introduction to dynamic systems . . . . . . 18
3.2  Formulating a system . . . . . . 19
3.3  Unrestricted variables . . . . . . 20
3.4  Special variables . . . . . . 21
3.5  Estimating an unrestricted system . . . . . . 21
3.6  Graphic analysis and multivariate testing . . . . . . 23
3.7  System reduction . . . . . . 26
3.8  Dynamic analysis . . . . . . 28
3.9  Recursive estimation . . . . . . 30
3.10  Batch editor . . . . . . 31
3.11  Forecasting . . . . . . 32
3.12  Equilibrium-correction representation . . . . . . 36
Chapter  4 Tutorial on Cointegration Analysis . . . . . . 39
4.1  Introduction to cointegration analysis . . . . . . 39
4.2  Intercepts and linear deterministic trends I . . . . . . 40
4.3  Unrestricted and restricted variables . . . . . . 40
4.4  Estimating the vector autoregression . . . . . . 41
4.5  Cointegration analysis . . . . . . 41
4.6  Intercepts and linear deterministic trends II . . . . . . 43
4.7  Recursive eigenvalues . . . . . . 44
4.8  Cointegration graphics . . . . . . 45
Chapter  5 Tutorial on Cointegrated VARs . . . . . . 48
5.1  Introduction . . . . . . 48
5.2  Imposing the rank of the cointegration space . . . . . . 48
5.3  Intercepts and linear deterministic trends III . . . . . . 51
5.4  Cointegration restrictions . . . . . . 51
5.5  Determining unique cointegration relations . . . . . . 54
5.6  Moving-average impact matrix . . . . . . 55
5.7  Cointegration graphics . . . . . . 56
5.8  Addendum: A and H matrices . . . . . . 58
Chapter  6 Tutorial on Reduction to I(0) . . . . . . 59
6.1  Introduction . . . . . . 59
6.2  A parsimonious VAR . . . . . . 64
6.3  A restricted system . . . . . . 67
6.4  Progress . . . . . . 72
Chapter  7 Tutorial on Simultaneous Equations Models . . . . . . 75
7.1  Introduction to dynamic models . . . . . . 75
7.2  The cointegrated VAR in I(0) space . . . . . . 76
7.3  Dynamic analysis and dynamic forecasting . . . . . . 80
7.4  Modelling the parsimonious VAR . . . . . . 85
7.5  Maximization control . . . . . . 86
7.6  How well did we do? . . . . . . 90
Chapter  8 Tutorial on Advanced VAR Modelling . . . . . . 92
8.1  Introduction . . . . . . 92
8.2  Loading the Lütkepohl data . . . . . . 92
8.3  Estimating a VAR . . . . . . 93
8.4  Dynamic analysis . . . . . . 95
8.5  Forecasting . . . . . . 96
8.6  Dynamic simulation and impulse response analysis . . . . . . 100
8.6.1  Impulse response analysis . . . . . . 100
8.7  Sequential reduction and information criteria . . . . . . 102
8.8  Diagnostic checking . . . . . . 104
8.9  Parameter constancy . . . . . . 106
8.10  Non-linear parameter constraints . . . . . . 110
PART III The Econometrics of Multiple Equation Modelling . . . . . . 115
Chapter  9 An Introduction to the Dynamic Econometric Systems . . . . . . 117
9.1  Summary of Part III . . . . . . 117
9.2  Introduction . . . . . . 118
9.3  Economic theoretical formulation . . . . . . 119
9.4  The statistical system . . . . . . 122
9.5  System dynamics . . . . . . 123
9.6  System evaluation . . . . . . 124
9.7  The impact of I(1) on econometric modelling . . . . . . 125
9.8  The econometric model and its identification . . . . . . 127
9.9  Simultaneous equations modelling . . . . . . 128
9.10  General to specific modelling of systems . . . . . . 129
9.10.1  The economy is a system . . . . . . 130
9.10.2  To test marginalization . . . . . . 130
9.10.3  Simultaneity . . . . . . 131
9.10.4  To test weak exogeneity . . . . . . 131
9.10.5  To check identification . . . . . . 131
9.10.6  Cointegration is a system property . . . . . . 131
9.10.7  To test cross-equation dependencies . . . . . . 132
9.10.8  To test super exogeneity and invariance . . . . . . 132
9.10.9  To conduct h-step forecasts . . . . . . 132
Chapter  10 Some Matrix Algebra . . . . . . 133
Chapter  11 Econometric Analysis of the System . . . . . . 141
11.1  System estimation . . . . . . 141
11.2  Maximum likelihood estimation . . . . . . 143
11.3  Recursive estimation . . . . . . 144
11.4  Unrestricted variables . . . . . . 145
11.5  Forecasting . . . . . . 146
11.5.1  Static forecasting . . . . . . 148
11.5.2  Dynamic forecasting . . . . . . 149
11.5.3  Dynamic forecasting: parameter uncertainty . . . . . . 151
11.5.4  Dynamic simulation and impulse response analysis . . . . . . 155
11.6  Dynamic analysis . . . . . . 156
11.7  Test types . . . . . . 158
11.8  Specification tests . . . . . . 160
11.8.1  Parameter constancy tests . . . . . . 163
11.9  Mis-specification tests . . . . . . 164
11.9.1  Single equation tests . . . . . . 164
  11.9.1.1Portmanteau statistic . . . . . . 165
  11.9.1.2LM test for autocorrelated residuals . . . . . . 165
  11.9.1.3LM test for autocorrelated squared residuals . . . . . . 166
  11.9.1.4Test for normality . . . . . . 166
  11.9.1.5Test for heteroscedasticity . . . . . . 167
11.9.2  Vector tests . . . . . . 167
  11.9.2.1Vector portmanteau statistic . . . . . . 168
  11.9.2.2Vector error autocorrelation test . . . . . . 168
  11.9.2.3Vector normality test . . . . . . 169
  11.9.2.4Vector heteroscedasticity test (using squares) . . . . . . 169
  11.9.2.5Vector heteroscedasticity test (using squares and cross-products) . . . . . . 170
Chapter  12 Cointegration Analysis . . . . . . 171
12.1  Introduction . . . . . . 171
12.2  Equilibrium correction models . . . . . . 171
12.3  Estimating the cointegrating rank . . . . . . 173
12.4  Deterministic terms and restricted variables . . . . . . 175
12.5  The I(2) analysis . . . . . . 176
12.6  Numerically stable estimation . . . . . . 178
12.7  Recursive estimation . . . . . . 178
12.8  Testing restrictions on alpha and beta . . . . . . 178
12.8.1  Introduction . . . . . . 178
12.8.2  Restrictions on alpha, H_a : alpha_1 = A_1 theta_1 . . . . . . 179
12.8.3  Restrictions on beta, H_b : beta_2 = H_2 phi_2 . . . . . . 179
12.8.4  Restrictions on beta, H_c : beta_3 = H_3:phi_3 . . . . . . 180
12.8.5  Combining restrictions on alpha and beta . . . . . . 180
12.8.6  Testing more general restrictions . . . . . . 180
12.9  Estimation under general restrictions . . . . . . 181
12.10  Identification . . . . . . 183
Chapter  13 Econometric Analysis of the Simultaneous Equations Model . . . . . . 185
13.1  The econometric model . . . . . . 185
13.2  Identification . . . . . . 186
13.3  The estimator generating equation . . . . . . 187
13.4  Maximum likelihood estimation . . . . . . 188
13.4.1  Linear parameters . . . . . . 188
13.4.2  Non-linear parameters . . . . . . 190
13.5  Estimators in PcGive . . . . . . 191
13.6  Recursive estimation . . . . . . 193
13.7  Computing FIML . . . . . . 194
13.8  Restricted reduced form . . . . . . 195
13.9  Unrestricted variables . . . . . . 196
13.10  Derived statistics . . . . . . 196
13.10.1  General restrictions . . . . . . 197
13.11  Progress . . . . . . 198
Chapter  14 Numerical Optimization and Numerical Accuracy . . . . . . 199
14.1  Introduction to numerical optimization . . . . . . 199
14.2  Maximizing likelihood functions . . . . . . 200
14.2.1  Direct search methods . . . . . . 200
14.2.2  Newton type methods . . . . . . 203
14.2.3  Derivative-free methods . . . . . . 204
14.2.4  Conclusion . . . . . . 205
14.3  Practical optimization . . . . . . 205
14.3.1  Maximization methods . . . . . . 206
14.3.2  Line search . . . . . . 206
14.3.3  Starting values . . . . . . 206
14.3.4  Recursive estimation . . . . . . 206
14.3.5  Convergence . . . . . . 207
14.3.6  End of iteration process . . . . . . 207
14.3.7  Process control . . . . . . 208
14.4  Numerical accuracy . . . . . . 208
PART IV The Statistical Output of Multiple Equation Models . . . . . . 211
Chapter  15 Unrestricted System . . . . . . 213
15.1  Introduction . . . . . . 213
15.2  System formulation . . . . . . 213
15.3  System estimation . . . . . . 214
15.4  System output . . . . . . 215
15.4.1  Equation output . . . . . . 215
15.4.2  Summary statistics . . . . . . 216
15.4.3  F-tests . . . . . . 217
15.4.4  Correlations . . . . . . 217
15.4.5  1-step (ex post) forecast analysis . . . . . . 218
15.4.6  *Information criteria . . . . . . 218
15.4.7  *Correlation matrix of regressors . . . . . . 219
15.4.8  *Covariance matrix of estimated parameters . . . . . . 219
15.4.9  *Static (1-step) forecasts . . . . . . 219
15.5  Graphic analysis . . . . . . 220
15.6  Recursive graphics . . . . . . 221
15.6.1  Dynamic forecasting . . . . . . 223
15.6.2  Dynamic simulation . . . . . . 225
15.7  Dynamic analysis . . . . . . 226
15.7.1  I(1) cointegration analysis . . . . . . 227
15.7.2  I(2) Cointegration analysis . . . . . . 228
15.8  System testing . . . . . . 229
15.8.1  Introduction . . . . . . 229
15.8.2  Single equation diagnostics . . . . . . 231
15.8.3  Vector tests . . . . . . 232
15.8.4  Testing for general restrictions . . . . . . 233
15.9  Progress . . . . . . 233
Chapter  16 Cointegrated VAR . . . . . . 235
16.0.1  Cointegration restrictions . . . . . . 235
16.1  Cointegrated VAR output . . . . . . 235
16.2  Graphic analysis . . . . . . 236
16.3  Recursive graphics . . . . . . 237
Chapter  17 Simultaneous Equations Model . . . . . . 238
17.1  Model estimation . . . . . . 238
17.2  Model output . . . . . . 239
17.3  Graphic analysis . . . . . . 241
17.4  Recursive graphics . . . . . . 241
17.5  Dynamic analysis, forecasting and simulation . . . . . . 241
17.6  Model testing . . . . . . 242
PART V Appendices . . . . . . 243
Chapter  A1 Algebra and Batch for Multiple Equation Modelling . . . . . . 245
A1.1  General restrictions . . . . . . 245
A1.1.1  Restrictions for testing . . . . . . 246
A1.1.2  Restrictions for estimation . . . . . . 246
A1.2  PcGive batch language . . . . . . 247
Chapter  A2 Numerical Changes From Previous Versions . . . . . . 254
Chapter References . . . . . . 255
Chapter Author Index . . . . . . 263
Chapter Subject Index . . . . . . 265


Books

Doornik, J.A. and Hendry, D.F. (2001). Econometric Modelling Using PcGive™ Volume III London: Timberlake Consultants Press. (ISBN 0-9533394-7-5)

Chapter List of Figures . . . . . . xi
Chapter List of Tables . . . . . . xiii
Chapter Preface . . . . . . xv
PART I Prologue . . . . . . 1
Chapter  1 Introduction to Volume III . . . . . . 3
1.1  The PcGive system . . . . . . 3
1.2  Citation . . . . . . 4
1.3  World Wide Web . . . . . . 4
PART II Volatility Models (GARCH) (with H. Peter Boswijk and Marius Ooms) . . . . . . 5
Chapter  2 Introduction to Volatility Models (GARCH) . . . . . . 7
2.1  Introduction . . . . . . 7
Chapter  3 Tutorial on GARCH Modelling . . . . . . 11
3.1  Estimating a GARCH(1,1) model . . . . . . 11
3.2  Evaluating the GARCH(1,1) model . . . . . . 15
3.3  Recursive estimation of the GARCH(1,1) model . . . . . . 17
3.4  GARCH(1,1) with regressors in the variance equation . . . . . . 20
3.5  GARCH(1,1) with Student t-distributed errors . . . . . . 22
3.6  EGARCH(1,1) GED-distributed errors . . . . . . 23
3.7  GARCH in mean . . . . . . 25
3.8  Asymmetric threshold GARCH . . . . . . 28
Chapter  4 GARCH Implementation Details . . . . . . 31
4.1  GARCH model settings . . . . . . 31
4.2  Some implementation details . . . . . . 33
4.3  GARCH batch commands . . . . . . 33
PART III Limited Dependent Models (LogitJD) . . . . . . 37
Chapter  5 Discrete choice models . . . . . . 39
5.1  Introduction . . . . . . 39
5.2  Binary discrete choice . . . . . . 39
5.3  The binary logit and probit model . . . . . . 40
5.4  Multinomial discrete choice . . . . . . 40
5.4.1  The multinomial logit model . . . . . . 42
5.4.2  Weighted estimation . . . . . . 43
5.5  Evaluation . . . . . . 43
5.5.1  Estimated probabilities . . . . . . 43
5.5.2  Likelihood ratio tests . . . . . . 43
5.5.3  Derivatives of probabilities . . . . . . 44
5.6  Histograms . . . . . . 45
5.7  Norm observations . . . . . . 46
5.8  Observed versus predicted . . . . . . 46
5.9  Outlier analysis . . . . . . 46
Chapter  6 Tutorial on Discrete Choice Modelling . . . . . . 47
6.1  Introduction . . . . . . 47
6.2  Data organization . . . . . . 48
6.3  Binary logit estimation . . . . . . 49
6.4  Binary probit estimation . . . . . . 53
6.5  Grouped logit estimation . . . . . . 54
6.6  Multinomial logit estimation . . . . . . 55
6.7  Conditional logit estimation . . . . . . 58
PART IV Panel Data Models (DPD) (with Manuel Arellano and Stephen Bond) . . . . . . 61
Chapter  7 Panel Data Models . . . . . . 63
7.1  Introduction . . . . . . 63
7.2  Econometric methods for static panel data models . . . . . . 64
7.2.1  Static panel-data estimation . . . . . . 64
7.3  Econometric methods for dynamic panel data models . . . . . . 65
Chapter  8 Tutorial on Static Panel Data Modelling . . . . . . 72
8.1  Introduction . . . . . . 72
8.2  Data organization . . . . . . 72
8.3  Static panel data estimation . . . . . . 74
Chapter  9 Tutorial on Dynamic Panel Data Modelling . . . . . . 79
9.1  Introduction . . . . . . 79
9.2  Data organization . . . . . . 79
9.3  One-step GMM estimation . . . . . . 80
9.4  Two-step GMM estimation . . . . . . 84
9.5  IV estimation . . . . . . 85
9.6  Combined GMM estimation . . . . . . 86
Chapter  10 Panel Data Implementation Details . . . . . . 89
10.1  Transformations . . . . . . 89
10.2  Static panel-data estimation . . . . . . 90
10.3  Dynamic panel data estimation . . . . . . 91
10.4  Dynamic panel data, combined estimation . . . . . . 95
10.5  Panel batch commands . . . . . . 96
PART V Time Series Models (ARFIMA) (with Marius Ooms) . . . . . . 99
Chapter  11 Introduction to Time Series Models (ARFIMA) . . . . . . 101
Chapter  12 Tutorial on ARFIMA Modelling . . . . . . 103
Chapter  13 ARFIMA Implementation Details . . . . . . 113
13.1  Introduction . . . . . . 113
13.2  The Arfima model . . . . . . 113
13.2.1  Autocovariance function . . . . . . 114
13.3  Estimation . . . . . . 115
13.3.1  Regressors in mean . . . . . . 115
13.3.2  Initial values . . . . . . 115
13.3.3  Exact maximum likelihood (EML) . . . . . . 116
13.3.4  Modified profile likelihood (MPL) . . . . . . 117
13.3.5  Non-linear least squares (NLS) . . . . . . 117
13.3.6  Variance-covariance matrix estimates . . . . . . 118
13.4  Estimation output . . . . . . 118
13.5  Estimation options . . . . . . 118
13.5.1  Sample mean versus known mean . . . . . . 118
13.5.2  Fixing parameters . . . . . . 119
13.5.3  Weighted estimation . . . . . . 119
13.5.4  Z variables . . . . . . 119
13.6  Forecasting . . . . . . 120
13.7  ARFIMA batch commands . . . . . . 121
PART VI X12arima for GiveWin . . . . . . 125
Chapter  14 Overview of X12arima for GiveWin . . . . . . 127
14.1  Introduction . . . . . . 127
14.2  X-12-ARIMA . . . . . . 127
14.3  Credits . . . . . . 128
14.4  Disclaimer . . . . . . 128
14.5  Limitations . . . . . . 128
14.6  Documentation . . . . . . 128
14.7  Census X-11 Seasonal Adjustment . . . . . . 129
14.8  X-12-ARIMA Seasonal Adjustment . . . . . . 130
14.9  regARIMA . . . . . . 131
14.10  X12arima menu commands . . . . . . 131
Chapter  15 Tutorial on Seasonal Adjustment with X12arima for GiveWin . . . . . . 133
15.1  Introduction . . . . . . 133
15.1.1  Starting GiveWin and X12arima . . . . . . 133
15.1.2  Loading the first data set . . . . . . 134
15.1.3  Quick Seasonal Adjustment . . . . . . 134
15.1.4  Formulate, Estimate and Diagnostic Graphics . . . . . . 138
15.2  Batch usage . . . . . . 140
Chapter  16 Tutorial on ARIMA Modelling with X12arima for GiveWin . . . . . . 141
16.1  Introduction . . . . . . 141
16.1.1  Formulating the ARIMA model . . . . . . 141
16.1.2  Model Output . . . . . . 143
16.2  regARIMA Model Example . . . . . . 145
16.2.1  Model Output . . . . . . 147
Chapter  17 Batch Usage . . . . . . 149
17.1  Additional Batch Commands . . . . . . 149
17.2  Specification Syntax, Additions and Differences . . . . . . 150
Chapter References . . . . . . 153
Chapter Author Index . . . . . . 159
Chapter Subject Index . . . . . . 161


Books

Hendry, D.F. and Krolzig, H.-M. (2001). Automatic Econometric Model Selection using PcGets, London: Timberlake Consultants Press.

Chapter List of Figures . . . . . . xvii
Chapter List of Tables . . . . . . xviii
Chapter Preface . . . . . . xix
PART I PcGets Prologue . . . . . . 1
Chapter  1 Introduction to PcGets . . . . . . 3
1.1  The Econometrics of PcGets . . . . . . 3
1.2  PcGets model selection . . . . . . 6
1.3  The special features of PcGets . . . . . . 7
Efficient model formulation . . . . . . 9
Automatic model selection . . . . . . 10
Thorough evaluation . . . . . . 11
1.4  Documentation conventions . . . . . . 11
1.5  Using PcGets documentation . . . . . . 12
1.6  An overview of PcGets menus . . . . . . 13
1.7  Citation . . . . . . 13
1.8  World Wide Web . . . . . . 13
1.9  Some data sets . . . . . . 13
Chapter  2 Getting Started . . . . . . 14
2.1  Starting PcGets . . . . . . 14
2.2  Loading and viewing the tutorial data set . . . . . . 15
2.3  GiveWin graphics . . . . . . 18
2.3.1  A first graph . . . . . . 18
2.3.2  Graph saving and printing . . . . . . 19
2.4  Calculator . . . . . . 21
PART II Tutorials on PcGets . . . . . . 23
Chapter  3 Tutorial on Model Formulation and Estimation . . . . . . 25
3.1  Starting PcGets . . . . . . 25
3.1.1  Lagged and deterministic variables . . . . . . 27
3.2  Formulating a model . . . . . . 28
3.3  Ordinary Least Squares (OLS) estimation . . . . . . 29
3.4  Model output . . . . . . 30
3.4.1  Equation estimates . . . . . . 30
3.4.2  Mis-specification tests . . . . . . 31
3.5  Instrumental Variables Estimation (IVE) . . . . . . 32
3.5.1  Structural estimates . . . . . . 33
3.6  Progress . . . . . . 34
Chapter  4 Tutorial on Post-Estimation Model Evaluation . . . . . . 36
4.1  Graphical evaluation . . . . . . 36
4.1.1  Graphical analysis dialog . . . . . . 36
4.1.2  Actual and fitted values . . . . . . 37
4.1.3  Residual analysis . . . . . . 38
4.2  Dynamic analysis . . . . . . 39
4.3  Analysis of forecasts . . . . . . 40
4.4  Collinearity analysis . . . . . . 42
4.4.1  An I(0) transformation . . . . . . 43
4.5  Specification tests . . . . . . 45
4.5.1  Exclusion restrictions . . . . . . 45
4.5.2  Linear restrictions . . . . . . 45
4.5.3  Omitted variables . . . . . . 46
4.6  Recursive analysis . . . . . . 47
4.6.1  Recursive OLS estimation . . . . . . 47
4.6.2  Recursive instrumental variables . . . . . . 48
4.6.3  Recursive graphics . . . . . . 48
Chapter  5 Tutorial on Automatic Model Selection . . . . . . 51
5.1  Formulating general models . . . . . . 51
5.2  Model settings for selection . . . . . . 52
5.3  Testimation - GETS . . . . . . 53
5.4  Testimation - GETSIVE . . . . . . 56
5.5  Sequential simplification of an I(0) GUM . . . . . . 57
5.5.1  Pre-search procedures . . . . . . 58
5.5.2  Multi-path searches . . . . . . 60
5.5.3  Omitted variables . . . . . . 61
5.5.4  Outlier removal . . . . . . 62
5.5.5  Iteration symbols . . . . . . 63
5.6  Pre-programmed selection settings . . . . . . 64
5.6.1  Liberal strategy . . . . . . 64
5.6.2  Conservative strategy . . . . . . 64
5.6.3  Multi-path selection . . . . . . 64
5.7  Constrained selection: using fixed variables . . . . . . 65
5.8  Expert settings . . . . . . 67
5.8.1  Significance levels for selection statistics . . . . . . 67
5.8.2  Block search t-probabilities . . . . . . 68
5.8.3  Information criteria . . . . . . 68
5.8.4  Sample split analysis . . . . . . 69
5.8.5  Outlier-correction criterion . . . . . . 69
5.8.6  Mis-specification test settings . . . . . . 69
5.8.7  Re-setting selection strategies . . . . . . 70
5.9  Applying PcGets substantively . . . . . . 70
5.9.1  UK money demand . . . . . . 70
5.9.2  UK consumers' expenditure . . . . . . 71
5.10  Advice on using PcGets in modelling . . . . . . 73
Chapter  6 Tutorial on Cross-section Model Selection . . . . . . 75
6.1  Formulating a regression . . . . . . 75
6.2  Model selection . . . . . . 76
6.2.1  Selection output . . . . . . 78
6.3  Regression graphics . . . . . . 81
6.4  Alternative selection strategies . . . . . . 82
6.5  Fixing selected variables . . . . . . 83
Chapter  7 Tutorial on Batch Usage . . . . . . 84
7.1  Batch codes generated by PcGets . . . . . . 84
7.2  Example . . . . . . 85
7.3  Editing batch files . . . . . . 88
7.4  Create your own liberal and conservative strategy . . . . . . 90
Chapter  8 Tutorial on Modelling VARs . . . . . . 94
8.1  Introduction . . . . . . 94
8.2  General-to-specific reductions of VAR models . . . . . . 94
8.3  A Small Monetary VAR of the UK . . . . . . 96
8.4  Conclusion . . . . . . 98
PART III The Econometrics of PcGets . . . . . . 99
Chapter  9 The Theory of Reduction . . . . . . 101
9.1  Introduction . . . . . . 101
9.1.1  Empirical models . . . . . . 102
9.2  Deriving the LDGP . . . . . . 102
9.2.1  DGP . . . . . . 103
9.2.2  Data transformations and aggregation . . . . . . 103
9.2.3  Parameters of interest . . . . . . 103
9.2.4  Data partition . . . . . . 103
9.2.5  Marginalization . . . . . . 104
9.2.6  Sequential factorization . . . . . . 104
9.2.7  Mapping to I(0) . . . . . . 104
9.2.8  Conditional factorization . . . . . . 104
9.2.9  Constancy . . . . . . 105
9.2.10  Lag truncation . . . . . . 105
9.2.11  Functional form . . . . . . 105
9.3  The econometric model . . . . . . 106
9.4  Econometric concepts as measures of no information loss . . . . . . 106
9.5  A taxonomy of evaluation information . . . . . . 107
9.6  Dominance . . . . . . 108
9.6.1  Information criteria . . . . . . 108
9.6.2  Encompassing . . . . . . 109
Chapter  10 The Econometrics of Model Selection . . . . . . 110
10.1  Introduction . . . . . . 110
10.2  The selection stages of PcGets . . . . . . 111
10.2.1  Formulating the GUM . . . . . . 111
  10.2.1.1Integrated variables . . . . . . 112
10.2.2  Mis-specification tests . . . . . . 113
  10.2.2.1Significant mis-specification tests . . . . . . 113
  10.2.2.2Integrated variables . . . . . . 113
10.2.3  Pre-search reductions . . . . . . 113
10.2.4  Multiple search paths . . . . . . 114
10.2.5  Encompassing . . . . . . 114
10.2.6  Information criteria . . . . . . 114
10.2.7  Sub-sample reliability . . . . . . 115
10.2.8  Type I and type II errors . . . . . . 115
10.3  Analyzing the algorithm . . . . . . 115
10.3.1  Costs of inference and costs of search . . . . . . 116
10.4  Selection probabilities . . . . . . 116
10.5  Deletion probabilities . . . . . . 118
10.6  Monte Carlo evidence on PcGets . . . . . . 120
Chapter  11 Refuting Potential Criticisms of Gets . . . . . . 122
11.1  Introduction . . . . . . 122
11.2  Data-based model selection . . . . . . 123
11.3  Measurement without theory . . . . . . 123
11.4  Data mining . . . . . . 124
11.5  Pre-test biases . . . . . . 125
11.6  Ignoring selection effects . . . . . . 125
11.7  Spurious significance from repeated testing . . . . . . 127
11.8  Arbitrary choices of significance levels . . . . . . 128
11.9  Lack of identification . . . . . . 129
11.10  Path dependence of selection . . . . . . 129
11.11  Implications . . . . . . 130
11.12  What are the alternatives? . . . . . . 131
11.12.1  The problems of simple-to-general modelling . . . . . . 132
11.12.2  Retaining the initial general model . . . . . . 132
11.12.3  Selecting models by minimizing an information criterion . . . . . . 133
11.12.4  Testing theory models . . . . . . 133
11.12.5  Other model-simplification approaches . . . . . . 134
11.12.6  Gets . . . . . . 134
11.12.7  Non-nested hypothesis tests and encompassing . . . . . . 134
11.12.8  Bayesian model comparisons . . . . . . 135
PART IV Statistics of PcGets . . . . . . 137
Chapter  12 Model Estimation Statistics . . . . . . 139
12.1  Introduction . . . . . . 139
12.2  Model formulation . . . . . . 139
12.3  OLS estimation . . . . . . 140
12.3.1  The algebra of ordinary least squares . . . . . . 141
12.3.2  *Correlations . . . . . . 141
12.3.3  Estimated regression equation . . . . . . 141
12.3.4  Variances . . . . . . 142
  12.3.4.1Standard errors of the regression coefficients . . . . . . 142
12.3.5  Some intermediate algebra . . . . . . 142
12.3.6  Functions of normal variables: chi^2, t and F distributions . . . . . . 143
12.3.7  Distributional results . . . . . . 144
12.3.8  t-values and t-probability . . . . . . 146
12.3.9  Subsets of parameters . . . . . . 146
12.3.10  *Parameter reliability statistics . . . . . . 148
12.3.11  Log-likelihood (LogLik) . . . . . . 148
12.3.12  R^2: squared multiple correlation coefficient . . . . . . 148
12.3.13  Equation standard error . . . . . . 149
12.3.14  Residual sum of squares (RSS) . . . . . . 149
12.3.15  Information criteria . . . . . . 149
12.4  Recursive OLS estimation . . . . . . 149
12.5  Forecasting . . . . . . 150
12.5.1  Analysis of 1-step forecasts . . . . . . 151
12.5.2  Dynamic forecasting . . . . . . 152
12.6  Instrumental variables estimation . . . . . . 153
12.6.1  The algebra of IVE . . . . . . 154
12.6.2  Testing hypotheses on beta . . . . . . 155
12.6.3  Specification chi^2 . . . . . . 155
12.6.4  Recursive IV estimation . . . . . . 156
Chapter  13 Post-estimation Evaluation Statistics . . . . . . 157
13.1  Introduction . . . . . . 157
13.2  Graphic analysis . . . . . . 158
13.3  Recursive graphics . . . . . . 158
13.4  Dynamic analysis . . . . . . 160
13.4.1  Static long-run solution . . . . . . 161
13.4.2  Roots of the autoregressive lag polynomial . . . . . . 161
13.5  Collinearity analysis . . . . . . 162
13.6  Forecasts . . . . . . 162
13.6.1  Constancy tests . . . . . . 162
13.7  Diagnostic tests . . . . . . 162
13.7.1  Portmanteau statistic . . . . . . 163
13.7.2  Test for autocorrelated residuals . . . . . . 164
13.7.3  Test for autocorrelated squared residuals . . . . . . 164
13.7.4  Test for normality . . . . . . 165
13.7.5  Test for heteroscedasticity using squares . . . . . . 165
13.7.6  Test for heteroscedasticity using squares and cross-products . . . . . . 166
13.7.7  Small-sample properties of the mis-specification tests . . . . . . 166
13.8  Linear restrictions test . . . . . . 168
13.9  Exclusion restrictions . . . . . . 168
13.10  Tests for omitted variables . . . . . . 168
13.11  Encompassing tests . . . . . . 169
PART V PcGets Menus and Options . . . . . . 171
Chapter  14 PcGets Menus . . . . . . 173
14.1  Overview . . . . . . 173
14.1.1  File Menu . . . . . . 173
14.1.2  Package Menu . . . . . . 173
14.1.3  Model Menu . . . . . . 173
14.1.4  Test Menu . . . . . . 174
14.1.5  Help Menu . . . . . . 174
14.2  File menu (Alt+f) . . . . . . 174
14.3  Package Menu . . . . . . 175
14.4  Model menu (Alt+m) . . . . . . 175
14.4.1  Formulate (Alt+y) . . . . . . 175
14.4.2  Model settings (Alt+s) . . . . . . 178
14.4.3  Estimate (Alt+l) . . . . . . 178
  14.4.3.1 Estimate Model dialog box . . . . . . 179
  14.4.3.2 Ordinary least squares (OLS) . . . . . . 179
  14.4.3.3 Testimation (GETS) . . . . . . 179
  14.4.3.4 Instrumental variables estimation (IVE) . . . . . . 180
  14.4.3.5 Instrumental variables testimation (GETSIVE) . . . . . . 180
14.4.4  Estimation output . . . . . . 180
  14.4.4.1 Estimated regression equation . . . . . . 180
  14.4.4.2 Summary regression statistics . . . . . . 181
14.4.5  Progress . . . . . . 184
  14.4.5.1 Progress dialog box . . . . . . 184
  14.4.5.2 Progress . . . . . . 184
14.4.6  Options (Alt+o) . . . . . . 184
14.5  Test menu (Alt+t) . . . . . . 185
14.5.1  Graphic analysis . . . . . . 185
  14.5.1.1 Graphic analysis dialog box . . . . . . 185
  14.5.1.2 Data density and histogram . . . . . . 185
  14.5.1.3 Correlogram (ACF, PACF) . . . . . . 186
  14.5.1.4 Spectrum . . . . . . 186
14.5.2  Recursive analysis . . . . . . 187
  14.5.2.1 Recursive analysis dialog box . . . . . . 187
  14.5.2.2 Recursive estimation . . . . . . 188
  14.5.2.3 Recursive analysis output . . . . . . 188
14.5.3  Dynamic analysis . . . . . . 188
14.5.4  Collinearity analysis . . . . . . 189
14.5.5  Forecast . . . . . . 189
14.5.6  Omitted variables . . . . . . 191
14.5.7  Linear restrictions . . . . . . 191
  14.5.7.1 Linear restrictions dialog box . . . . . . 191
14.5.8  Exclusion restrictions . . . . . . 192
14.5.9  LaTeX output . . . . . . 193
14.5.10  PcGets settings . . . . . . 193
14.5.11  PcGets batch output . . . . . . 193
14.5.12  Store in database . . . . . . 193
14.6  Help menu (Alt+h) . . . . . . 194
14.6.1  Help topics . . . . . . 194
14.6.2  Contents . . . . . . 194
14.6.3  About . . . . . . 194
Chapter  15 Model-selection Strategy Options . . . . . . 195
15.1  Introduction . . . . . . 195
15.2  Model settings dialog box . . . . . . 195
15.2.1  PcGets testimation algorithm . . . . . . 195
15.2.2  Research strategy . . . . . . 195
15.2.3  Reporting . . . . . . 196
15.3  Model settings options . . . . . . 196
15.3.1  Outlier correction . . . . . . 196
15.3.2  F pre-search testing (lag order pre-selection) . . . . . . 196
15.3.3  F pre-search testing (top-down) . . . . . . 196
15.3.4  F pre-search testing (bottom-up) . . . . . . 196
15.3.5  Sample-split analysis . . . . . . 196
15.3.6  Sample-size adjusted significance level . . . . . . 197
15.3.7  Modelling strategies . . . . . . 197
15.3.8  Reporting . . . . . . 198
15.4  Options (Expert user's strategy) . . . . . . 198
15.4.1  Significance levels . . . . . . 198
15.4.2  F pre-search tests) . . . . . . 199
15.4.3  Block search . . . . . . 199
15.4.4  Selection criteria for final model . . . . . . 200
15.4.5  Sample-split analysis . . . . . . 200
15.4.6  Outlier detection . . . . . . 201
15.4.7  Diagnostic tests . . . . . . 201
15.4.8  Test options . . . . . . 201
15.4.9  Reset default . . . . . . 202
Chapter  16 PcGets Batch Language . . . . . . 203
16.1  Introduction . . . . . . 203
16.2  PcGets batch commands . . . . . . 203
16.2.1  Batch control of the Model Formulation dialog . . . . . . 205
16.2.2  Batch control of the Model Estimation dialog . . . . . . 206
16.2.3  Batch control of the Model Settings dialog . . . . . . 206
16.2.4  Batch control of the Options dialog . . . . . . 207
16.2.5  Batch control of the test dialog . . . . . . 209
16.3  Illustrative batch code . . . . . . 211
Chapter  A1 The PcGets Algorithm . . . . . . 212
A1.1  The PcGets algorithm . . . . . . 212
Chapter References . . . . . . 215
Chapter Author Index . . . . . . 225
Chapter Subject Index . . . . . . 227


Books

Doornik, J.A. and Hendry, D.F. (2001). Interactive Monte Carlo Experimentation in Econometrics Using PcNaive, London: Timberlake Consultants Press.

Chapter List of Figures . . . . . . xiii
Chapter List of Example Programs . . . . . . xv
Chapter Preface . . . . . . xvii
PART I PcNaive Prologue . . . . . . 1
Chapter  1 Introduction to PcNaive . . . . . . 3
1.1  General information . . . . . . 3
1.2  The special features of PcNaive . . . . . . 3
1.3  An overview of PcNaive . . . . . . 5
1.4  Documentation conventions . . . . . . 7
1.5  Using PcNaive documentation . . . . . . 7
1.6  Citation . . . . . . 8
1.7  World Wide Web . . . . . . 8
1.8  Installation and run-time issues . . . . . . 8
Chapter  2 The Data Generation Processes and Models of PcNaive . . . . . . 9
2.1  AR(1) DGP . . . . . . 9
2.1.1  Data generation process . . . . . . 9
2.1.2  Model . . . . . . 9
2.1.3  Estimates and tests . . . . . . 9
2.1.4  Plots . . . . . . 10
2.2  Static DGP . . . . . . 10
2.2.1  Data generation process . . . . . . 10
2.2.2  Model . . . . . . 10
2.2.3  Estimates and tests . . . . . . 10
2.2.4  Plots . . . . . . 10
2.3  PcNaive and General DGP . . . . . . 11
2.3.1  Data generation process for PcNaive DGP . . . . . . 11
  2.3.1.1 PcNaive DGP in equilibrium-correction form . . . . . . 12
  2.3.1.2 PcNaive DGP with break . . . . . . 12
2.3.2  Data generation process for the General DGP . . . . . . 12
2.3.3  Models . . . . . . 13
2.3.4  Estimates . . . . . . 13
2.3.5  Tests . . . . . . 13
2.3.6  Plots . . . . . . 16
PART II PcNaive Tutorials . . . . . . 17
Chapter  3 Introduction to Monte Carlo Experimentation . . . . . . 19
3.1  PcNaive . . . . . . 19
3.2  Monte Carlo . . . . . . 20
3.3  The data generation process . . . . . . 21
3.4  Simulation methods . . . . . . 22
3.5  The output of PcNaive . . . . . . 22
Chapter  4 Tutorial for an IN[mu,sigma^2] Process . . . . . . 23
4.1  Introduction . . . . . . 23
4.2  Starting PcNaive . . . . . . 24
4.3  Designing the IN[mu,sigma^2] experiment . . . . . . 25
4.4  Saving the IN[mu,sigma^2] experiment . . . . . . 27
4.5  Running the IN[mu,sigma^2] experiment . . . . . . 27
4.6  Output from the IN[mu,sigma^2] experiment . . . . . . 27
4.7  Extended IN[mu,sigma^2] experiment . . . . . . 29
4.8  Graphical output . . . . . . 32
4.8.1  Recursive Monte Carlo . . . . . . 32
Chapter  5 Tutorial on the Static DGP . . . . . . 34
5.1  Introduction . . . . . . 34
5.2  Designing the Static experiment . . . . . . 34
5.2.1  Output from the experiment . . . . . . 35
  5.2.1.1 Description of the experiment . . . . . . 35
  5.2.1.2 A `manual' Monte Carlo . . . . . . 36
  5.2.1.3 Simulation output . . . . . . 37
5.2.2  Graphical output from the Static DGP . . . . . . 39
Chapter  6 Tutorial for the AR(1) DGP . . . . . . 41
6.1  Introduction . . . . . . 41
6.2  Designing the AR(1) experiment . . . . . . 41
6.2.1  Coefficient output from the AR(1) Process . . . . . . 42
6.2.2  Test output from the AR(1) Process . . . . . . 45
6.3  Recursive Monte Carlo . . . . . . 46
Chapter  7 Tutorial on the PcNaive DGP . . . . . . 48
7.1  Introduction . . . . . . 48
7.2  Example 1: AR(1) process . . . . . . 48
7.2.1  General page . . . . . . 49
7.2.2  Y DGP page . . . . . . 49
7.2.3  Z DGP page . . . . . . 50
7.2.4  Errors page . . . . . . 51
7.2.5  Model page . . . . . . 51
7.2.6  Stats page . . . . . . 52
7.2.7  Settings page . . . . . . 53
7.2.8  Saving and running the experiment . . . . . . 53
7.2.9  Output from the experiment . . . . . . 53
7.3  Example 2: unit roots . . . . . . 54
7.3.1  DF and ADF tests for unit roots . . . . . . 54
7.3.2  Experiments with unit roots . . . . . . 55
7.3.3  Single equation model with cointegration . . . . . . 58
7.3.4  Cointegration analysis . . . . . . 59
7.3.5  DGP in equilibrium correction form . . . . . . 60
7.4  Example 3: autoregressive error and asymptotic analysis . . . . . . 62
7.5  Example 4: simultaneity and inter-estimator comparison . . . . . . 67
7.6  Example 5: cointegration analysis with dummies . . . . . . 70
7.7  Example 6: structural breaks . . . . . . 73
Chapter  8 Tutorial on the General DGP . . . . . . 76
8.1  Introduction . . . . . . 76
8.2  Implementing the DGP . . . . . . 77
8.3  Specifying the equilibrium correction model . . . . . . 80
Chapter  9 Tutorial on the PcNaive Code . . . . . . 82
9.1  Introduction . . . . . . 82
9.2  Program and class structure . . . . . . 82
9.3  A generated program . . . . . . 83
9.4  Extending PcNaive . . . . . . 86
PART III Learning Econometrics Using PcNaive . . . . . . 89
Chapter  10 Introduction . . . . . . 91
Chapter  11 Elementary Econometrics . . . . . . 93
11.1  The concept of variation . . . . . . 93
11.2  Shapes of some statistical distributions . . . . . . 93
11.3  How sample size affects distributional shape . . . . . . 94
11.4  Comparing t and normal . . . . . . 94
11.5  Convergence to normality: A Central Limit theorem at work . . . . . . 95
11.6  Bivariate regression theory really works . . . . . . 95
11.7  The accuracy of estimated coefficient standard errors . . . . . . 96
11.8  Fixed versus stochastic regressors . . . . . . 98
11.9  Omitted variables: compounding bias and variance . . . . . . 99
11.10  The effects of non-normal equation errors . . . . . . 101
11.11  The effects of data measurement errors . . . . . . 102
Chapter  12 Intermediate econometrics . . . . . . 104
12.1  The impact of time: bias in autoregressive model estimation . . . . . . 104
12.2  Autocorrelated errors in regression equations . . . . . . 105
12.2.1  Biased variance in a static model . . . . . . 105
12.2.2  Biased coefficients in dynamic models . . . . . . 106
12.3  Inter-estimator comparisons: OLS and IV in a simultaneous system . . . . . . 107
12.4  The theory of Monte Carlo . . . . . . 107
12.5  Recursion in Monte Carlo applications . . . . . . 108
12.6  Test power: the impact of increasing sample size . . . . . . 108
12.7  The impact of dynamics on Chow test rejection frequencies . . . . . . 109
12.8  Nonsense regressions: the impact of evolution over time . . . . . . 109
12.9  Testing for unit roots . . . . . . 112
12.10  Testing for cointegration . . . . . . 114
12.11  Invalid weak exogeneity in a cointegration equation . . . . . . 116
Chapter  13 Advanced econometrics . . . . . . 117
13.1  The role of asymptotic distribution theory in Monte Carlo . . . . . . 117
13.2  Distributions of inconsistent estimators . . . . . . 117
13.3  The impacts of structural breaks on econometric modelling . . . . . . 118
13.4  Testing the Lucas critique . . . . . . 118
13.5  Encompassing and non-nested hypothesis tests . . . . . . 118
13.6  Non-existence of moments . . . . . . 118
13.6.1  The Cauchy distribution . . . . . . 119
13.6.2  No moments in an instrumental variables estimator . . . . . . 120
13.7  Cointegration analysis . . . . . . 121
PART IV Monte Carlo Theory . . . . . . 125
Chapter  14 Monte Carlo Methods . . . . . . 127
14.1  Stochastic solutions to deterministic problems . . . . . . 127
14.2  Distribution sampling . . . . . . 128
14.3  Sophisticated Monte Carlo . . . . . . 133
14.3.1  Antithetic variates . . . . . . 133
14.3.2  Control variables . . . . . . 135
14.3.3  Common random numbers . . . . . . 137
14.4  Invariance . . . . . . 138
14.5  Asymptotic analysis . . . . . . 139
14.5.1  The design of Monte Carlo experiments . . . . . . 139
14.5.2  How small is small? . . . . . . 140
14.5.3  Controlling inter-experiment variability . . . . . . 140
14.5.4  Elucidating test powers . . . . . . 141
14.6  Recursive Monte Carlo . . . . . . 141
14.6.1  Introduction: estimating the sample mean . . . . . . 141
14.6.2  The general approach . . . . . . 143
14.6.3  Recursive updating of Monte Carlo calculations . . . . . . 144
14.7  Experimental design . . . . . . 145
14.8  Post-simulation analysis . . . . . . 145
14.9  Random number generation . . . . . . 146
Chapter  15 Response surfaces . . . . . . 149
15.1  Introduction . . . . . . 149
15.2  The general approach . . . . . . 149
15.3  Experimental design, simulation, and post-simulation analysis . . . . . . 152
15.4  Heteroscedasticity . . . . . . 153
15.5  Testing the statistical adequacy of response surfaces . . . . . . 154
15.6  Numerical accuracy of response surfaces . . . . . . 156
15.7  Response surface formulations . . . . . . 157
15.7.1  First moments . . . . . . 157
15.7.2  Second moments . . . . . . 158
15.7.3  Estimated standard errors . . . . . . 159
15.7.4  Test rejection frequencies . . . . . . 159
15.8  Simpler forms of response surfaces . . . . . . 161
15.9  Conclusion . . . . . . 162
Chapter  16 Asymptotic Analysis . . . . . . 163
16.1  Introduction . . . . . . 163
16.2  The DGP for asymptotic analysis . . . . . . 163
16.2.1  An illustration . . . . . . 164
16.3  Companion form . . . . . . 164
16.3.1  An illustration -- continued . . . . . . 167
16.4  Asymptotic moments . . . . . . 168
16.4.1  An illustration -- continued . . . . . . 170
16.5  Asymptotic statistics . . . . . . 170
16.5.1  The estimators . . . . . . 171
16.5.2  The asymptotic statistics . . . . . . 172
16.5.3  An illustration -- continued . . . . . . 173
16.5.4  Power calculations . . . . . . 176
16.5.5  An illustration -- continued . . . . . . 177
Chapter References . . . . . . 179
Chapter Author Index . . . . . . 187
Chapter Subject Index . . . . . . 189


Books

Koopman S.J., Harvey, A.C., Doornik, J.A. and Shephard, N. (2000). STAMP: Structural Time Series Analyser, Modeller and Predictor, London: Timberlake Consultants Press. (ISBN 0-9533394-4-0).

Chapter List of Figures . . . . . . xv
Chapter List of Tables . . . . . . xvii
Chapter Preface . . . . . . xix
Chapter The Authors . . . . . . xxi
PART I Prologue . . . . . . 1
Chapter  1 Introduction . . . . . . 3
1.1  Overview of the STAMP book . . . . . . 3
1.2  General information . . . . . . 4
1.3  The special features of STAMP . . . . . . 5
1.4  Basics of the program . . . . . . 7
1.4.1  Data storage and input . . . . . . 7
1.4.2  Menus and dialogs . . . . . . 8
1.4.3  Help system . . . . . . 9
1.4.4  Results storage . . . . . . 9
1.5  Using STAMP documentation . . . . . . 9
1.6  Citation . . . . . . 11
1.7  World Wide Web . . . . . . 11
1.8  Tutorial data sets . . . . . . 11
1.8.1  ENERGY: energy consumption in the UK . . . . . . 11
1.8.2  EXCH: daily exchange rates for the US dollar . . . . . . 12
1.8.3  INTEREST: short- and long-term interest rates . . . . . . 12
1.8.4  MINKMUSK: minks and muskrats in Canada . . . . . . 13
1.8.5  NILE: level of the Nile . . . . . . 13
1.8.6  RAINBRAZ: rainfall in north-east Brazil . . . . . . 13
1.8.7  SEATBELT and SEATBQ: road casualties in Great Britain and the 1983 seat belt law . . . . . . 14
1.8.8  SPIRIT: consumption of spirits in the UK . . . . . . 14
1.8.9  TELEPHON: telephone calls to three different countries . . . . . . 14
1.8.10  UKCYP: consumption, income and prices in the UK . . . . . . 14
1.8.11  USYCIMP: US macroeconomic time series . . . . . . 15
1.9  Data sets used in exercises . . . . . . 16
1.10  STAMP and PcGive/PcFiml . . . . . . 16
Chapter  2 Getting Started . . . . . . 18
2.1  Starting STAMP . . . . . . 18
2.2  Loading and viewing the tutorial data set . . . . . . 19
2.3  GiveWin graphics . . . . . . 21
2.3.1  A first graph . . . . . . 21
2.3.2  Graph saving and printing . . . . . . 23
2.4  Data transformations . . . . . . 23
PART II Tutorials on Structural Time Series Modelling . . . . . . 27
Chapter  3 Introduction to Univariate Modelling . . . . . . 29
3.1  Model formulation . . . . . . 29
3.2  Evaluating and testing the model . . . . . . 33
3.2.1  Further output . . . . . . 34
3.2.2  Components graphics . . . . . . 35
3.2.3  Residuals graphics . . . . . . 37
3.2.4  Forecasting . . . . . . 38
3.2.5  Prediction graphics . . . . . . 39
3.3  Exercises . . . . . . 40
Chapter  4 Tutorial on Components . . . . . . 42
4.1  Selection of components . . . . . . 42
4.2  Trend . . . . . . 43
4.2.1  Local level model . . . . . . 43
4.2.2  Statistical analysis of the local level model . . . . . . 45
4.2.3  Local linear trend and smooth trend . . . . . . 46
4.2.4  Statistical specification of the local linear trend model . . . . . . 46
4.2.5  Specification of the trend . . . . . . 48
4.3  Seasonal . . . . . . 48
4.3.1  Specifying and testing the seasonal component . . . . . . 49
4.3.2  Seasonal adjustment . . . . . . 51
4.4  Cycle . . . . . . 52
4.4.1  A simple cycle plus noise model . . . . . . 52
4.4.2  Statistical specification . . . . . . 54
4.4.3  Trend plus cycle . . . . . . 55
4.4.4  Multiple cycles . . . . . . 55
4.5  Autoregression . . . . . . 56
4.6  Exercises . . . . . . 57
Chapter  5 Tutorial on Interventions and Explanatory Variables . . . . . . 58
5.1  Interventions . . . . . . 58
5.1.1  Modelling . . . . . . 59
5.1.2  Detection using auxiliary residuals . . . . . . 60
5.1.3  Specification of more complex interventions . . . . . . 62
5.2  Explanatory variables . . . . . . 64
5.2.1  Stochastic trend component . . . . . . 64
5.2.2  Outliers and structural breaks . . . . . . 67
5.2.3  Lags and differences . . . . . . 67
5.3  Forecasts . . . . . . 68
5.3.1  Incremental change . . . . . . 69
5.3.2  Manual input . . . . . . 70
5.3.3  Using models to forecast the explanatory variables . . . . . . 70
5.3.4  Forecasts in the database . . . . . . 70
5.3.5  Interventions . . . . . . 70
5.4  Error correction and unobserved components . . . . . . 71
5.5  Statistical features of the models . . . . . . 72
5.6  Exercises . . . . . . 73
Chapter  6 Tutorial on Multivariate Models . . . . . . 74
6.1  SUTSE models . . . . . . 74
6.1.1  Covariances and correlations . . . . . . 74
6.1.2  Homogeneity . . . . . . 75
6.1.3  Statistical specification . . . . . . 76
6.2  Cycles . . . . . . 76
6.3  Autoregression . . . . . . 79
6.4  Common factors and cointegration . . . . . . 80
6.4.1  Statistical specification of common levels . . . . . . 80
6.4.2  An example of common levels: road casualties in Britain . . . . . . 81
6.4.3  Further analysis of the seat-belt data: parameter restrictions* . . . . . . 83
6.4.4  Common trends . . . . . . 84
6.4.5  Common seasonals . . . . . . 87
6.4.6  Common cycles . . . . . . 87
6.4.7  Factor rotations . . . . . . 87
6.5  Explanatory variables and interventions . . . . . . 88
6.6  Assessing the effect of the seat belt law using a control group . . . . . . 88
6.7  Exercises . . . . . . 90
Chapter  7 Applications in Macroeconomics and Finance . . . . . . 91
7.1  GNP and investment . . . . . . 91
7.2  Income and consumption . . . . . . 93
7.3  Expected inflation . . . . . . 95
7.4  Long and short term interest rates . . . . . . 96
7.5  Stochastic volatility . . . . . . 97
7.6  Multivariate stochastic volatility . . . . . . 99
7.7  Seasonal adjustment and detrending . . . . . . 100
7.7.1  Seasonal adjustment . . . . . . 101
7.7.2  Detrending . . . . . . 101
7.8  Exercises . . . . . . 102
Chapter  8 Tutorial on Model Building and Testing . . . . . . 103
8.1  Specification of univariate models . . . . . . 103
8.1.1  Formulate a model . . . . . . 104
8.1.2  Selection of components . . . . . . 105
8.1.3  Selection of interventions . . . . . . 107
8.2  Multivariate models . . . . . . 108
8.2.1  Variance matrix restrictions . . . . . . 109
8.2.2  Equation restrictions . . . . . . 110
8.3  Estimate a model . . . . . . 111
8.3.1  Estimate Model dialog . . . . . . 111
8.3.2  Maximum likelihood . . . . . . 112
8.3.3  Maximum likelihood (control) . . . . . . 113
8.3.4  Edit/Restrict parameter values . . . . . . 115
8.3.5  Options . . . . . . 116
8.4  Model evaluation and testing . . . . . . 117
8.4.1  Estimation report . . . . . . 118
8.4.2  Diagnostic summary report . . . . . . 119
8.4.3  Further output . . . . . . 120
8.4.4  Components graphics . . . . . . 123
8.4.5  Residuals graphics . . . . . . 124
8.4.6  Auxiliary residuals graphics . . . . . . 125
8.4.7  Predictive testing . . . . . . 126
8.5  Forecasting . . . . . . 126
8.5.1  Without explanatory variables . . . . . . 127
8.5.2  Interventions . . . . . . 128
8.5.3  Explanatory variables . . . . . . 128
PART III Statistical Output . . . . . . 131
Chapter  9 Descriptive Statistics . . . . . . 133
9.1  Transformations . . . . . . 133
9.2  Correlogram . . . . . . 134
9.3  Periodogram . . . . . . 135
9.4  Spectrum . . . . . . 136
9.5  CUSUM . . . . . . 136
9.6  CUSUM of squares . . . . . . 137
9.7  Histogram . . . . . . 137
9.8  Density estimation . . . . . . 137
9.9  Distribution function . . . . . . 138
9.10  Write report . . . . . . 138
9.10.1  Serial correlation . . . . . . 138
9.10.2  Normality test . . . . . . 138
Chapter  10 Statistical Treatment of Models . . . . . . 140
10.1  Model definitions . . . . . . 140
10.1.1  Univariate time series models . . . . . . 140
10.1.2  Explanatory variables and interventions . . . . . . 142
10.1.3  Multivariate time series models . . . . . . 142
10.1.4  Common factors . . . . . . 143
  10.1.4.1Common levels . . . . . . 143
  10.1.4.2Smooth trends with common slopes . . . . . . 144
  10.1.4.3Common trends: level and slopes . . . . . . 144
  10.1.4.4Common seasonals . . . . . . 145
  10.1.4.5Common cycles . . . . . . 146
10.1.5  Explanatory variables . . . . . . 146
10.2  State space form . . . . . . 146
10.2.1  Structural time series models in SSF . . . . . . 148
  10.2.1.1 Univariate models in SSF . . . . . . 148
  10.2.1.2 Multivariate model in SSF . . . . . . 149
  10.2.1.3 Deterministic trend and seasonal components . . . . . . 150
10.3  Kalman filter . . . . . . 150
10.3.1  The augmented Kalman filter . . . . . . 152
10.3.2  The likelihood function . . . . . . 153
  10.3.2.1 Univariate models: the concentrated likelihood . . . . . . 153
  10.3.2.2 Homogeneous models . . . . . . 154
  10.3.2.3 Multivariate models . . . . . . 155
10.3.3  Prediction error variance . . . . . . 155
10.3.4  The final state and regression estimates . . . . . . 155
10.3.5  Filtered components . . . . . . 156
10.3.6  Residuals . . . . . . 156
  10.3.6.1 Generalised least squares residuals . . . . . . 156
  10.3.6.2 Generalised recursive residuals . . . . . . 157
10.4  Disturbance smoother . . . . . . 157
10.4.1  The augmented disturbance smoother . . . . . . 158
10.4.2  The EM algorithm and exact score . . . . . . 158
10.4.3  Smoothed components . . . . . . 159
10.4.4  Auxiliary residuals . . . . . . 160
10.5  Forecasting . . . . . . 160
10.5.1  Forecasts of series and components . . . . . . 160
10.5.2  Extrapolative residuals . . . . . . 161
10.6  Parameter estimation . . . . . . 161
10.6.1  The parameters of STAMP . . . . . . 161
  10.6.1.1 Variance matrices in a multivariate model . . . . . . 162
  10.6.1.2 Vector autoregressive components . . . . . . 163
10.6.2  BFGS Estimation procedure* . . . . . . 163
10.6.3  Estimation of univariate models* . . . . . . 165
  10.6.3.1 Initial values . . . . . . 165
  10.6.3.2 Strategy for setting parameters fixed . . . . . . 166
  10.6.3.3 Strategy for determining the concentrated parameter . . . . . . 166
10.6.4  Estimation of multivariate models* . . . . . . 167
  10.6.4.1 Initial values . . . . . . 167
  10.6.4.2 Strategy for fixing parameters . . . . . . 167
10.7  Appendix 1: Diffuse distributions* . . . . . . 168
10.7.1  Collapse of the augmented KF . . . . . . 168
10.7.2  Likelihood calculation . . . . . . 169
10.7.3  Recursive regressions . . . . . . 169
10.8  Appendix 2: Numerical optimisation* . . . . . . 170
10.8.1  Newton type methods . . . . . . 170
10.8.2  Numerical score vector and diagonal Hessian matrix . . . . . . 171
Chapter  11 Model Output . . . . . . 172
11.1  Output from STAMP . . . . . . 172
11.1.1  Model estimation . . . . . . 172
11.1.2  Selected model and estimation output . . . . . . 173
11.1.3  Summary statistics . . . . . . 173
11.1.4  The sample period . . . . . . 173
11.1.5  Test . . . . . . 174
11.2  Parameters . . . . . . 174
11.2.1  Variances and standard deviations . . . . . . 174
11.2.2  Cycle and AR(1) . . . . . . 174
11.2.3  Variance matrices (multivariate models) . . . . . . 175
11.2.4  Factor loading matrices (multivariate models) . . . . . . 175
11.2.5  Transformed parameters and standard errors . . . . . . 175
11.3  Final state . . . . . . 176
11.3.1  Analysis of state . . . . . . 176
11.3.2  Regression analysis . . . . . . 177
11.3.3  Seasonal tests . . . . . . 177
11.3.4  Cycle tests . . . . . . 178
11.3.5  Data in logs . . . . . . 178
11.4  Goodness of fit . . . . . . 178
11.4.1  Prediction error variance . . . . . . 178
11.4.2  Prediction error mean deviation . . . . . . 179
11.4.3  Coefficients of determination . . . . . . 179
11.4.4  Information criteria : AIC and BIC . . . . . . 180
11.5  Components . . . . . . 180
11.5.1  Series with components . . . . . . 180
11.5.2  Detrended . . . . . . 181
11.5.3  Seasonally adjusted . . . . . . 181
11.5.4  Individual seasonals . . . . . . 181
11.5.5  Data in logs . . . . . . 181
11.6  Residuals . . . . . . 181
11.6.1  Correlogram . . . . . . 182
11.6.2  Periodogram and spectrum . . . . . . 182
11.6.3  Cumulative statistics and graphs . . . . . . 182
11.6.4  Distribution statistics . . . . . . 183
11.6.5  Heteroskedasticity . . . . . . 183
11.7  Auxiliary residuals . . . . . . 183
11.8  Predictive testing . . . . . . 184
11.9  Forecast . . . . . . 185
Chapter  A1 STAMP Batch Language . . . . . . 186
Chapter  A2 Numerical Changes from Previous Versions . . . . . . 190
A2.1  From version 5 to 6 . . . . . . 190
Chapter References . . . . . . 191
Chapter Author Index . . . . . . 197
Chapter Subject Index . . . . . . 199


Books

Cramer J.S. (2001). An Introduction to the Logit Model for Economists, London: Timberlake Consultants Press. (ISBN 0-9533394-6-7).

1. Introduction;
2. The binary model;
3. Maximum likelihood estimation of the binary logit model;
4. Some statistical tests and measures of fit;
5. Outliers, misclassification of outcomes, and omitted variables;
6. Analyses of separate samples;
7. The standard multinomial logit model;
8. Discrete choice of random utility models;


Home | Software | Training | Bookshop | Students | Support | Purchasing | About Us