\section{Estimators and tests: summary}
\label{estimators}

Table~\ref{tab-estim} shows the estimators available under the Model
menu in \app{gretl}'s main window.  The corresponding script command
(if there is one available) is shown in parentheses.  For details
consult the command's entry in chapter~\ref{cmdref}.
    
\begin{table}[htbp]
  \caption{Estimators}
  \label{tab-estim}
  \begin{center}
    \begin{tabular}{l>{\raggedright\arraybackslash}p{275pt}}
      \textit{Estimator} & \textit{Comment} \\ [4pt]
      Ordinary Least Squares (\cmd{ols}) & 
      The workhorse estimator \\
      Weighted Least Squares (\cmd{wls}) & 
      Heteroskedasticity, exclusion of selected observations \\
      HCCM (\cmd{hccm}) & 
      Heteroskedasticity corrected covariance matrix \\
      Heteroskedasticity corrected (\cmd{hsk}) & 
      Weighted Least Squares based on predicted error variance \\
      AR(1) (\cmd{ar1}) & First-order autocorrelation \\
      Autoregressive Estimation (\cmd{ar}) & 
      Higher-order autocorrelation (generalized Cochrane--Orcutt) \\
      ARMAX (\cmd{arma}) & Time-series model with ARMA error \\
      GARCH (\cmd{garch}) & Generalized Autoregressive Conditional
      Heteroskedasticity \\
      Vector Autoregression (\cmd{var}) & 
      Systems of time-series equations \\
      Cointegration test (\cmd{coint}) & 
      Long-run relationships between series \\
      Two-Stage Least Squares (\cmd{tsls}) & 
      Simultaneous equations \\
      Nonlinear Least Squares (\cmd{nls}) & Nonlinear models \\
      Logit (\cmd{logit}) & 
      Binary dependent variable (logistic distribution) \\
      Probit (\cmd{probit}) & 
      Binary dependent variable (normal distribution) \\
      Tobit (\cmd{tobit}) & Truncated dependent variable \\
      Logistic (\cmd{logistic}) & 
      OLS, with logistic transformation of dependent variable \\
      Least Absolute Deviation (\cmd{lad}) & Alternative to Least Squares \\
      Rank Correlation (\cmd{spearman}) & Correlation with ordinal data \\
      Multiple precision OLS (\cmd{mpols}) & 
      OLS estimation using multiple precision arithmetic \\
    \end{tabular}
  \end{center}
\end{table}

Table~\ref{tab-tests} shows the tests that are available under the
Tests menu in a model window, after estimation.

\begin{table}[htbp]
  \caption{Tests for models}
  \label{tab-tests}
  \begin{center}
    \begin{tabular}{ll}
      \textit{Test} & \textit{Corresponding command} \\ [4pt]
      Omit variables (\emph{F}-test if OLS) & \cmd{omit} \\
      Add variables (\emph{F}-test if OLS) & \cmd{add} \\
      Sum of coefficients (\emph{t}-test if OLS) & \cmd{coeffsum} \\
      Nonlinearity (squares) & \cmd{lmtest --squares} \\
      Nonlinearity (logs) & \cmd{lmtest --logs} \\
      Nonlinearity (Ramsey's RESET) & \cmd{reset} \\
      Heteroskedasticity (White's test) & \cmd{lmtest --white} \\
      Influential observations & \cmd{leverage} \\
      Autocorrelation up to the data frequency & \cmd{lmtest --autocorr} \\
      Chow (structural break) & \cmd{chow} \\
      CUSUM (parameter stability) & \cmd{cusum} \\
      ARCH (conditional heteroskedasticity) & \cmd{arch} \\
      Normality of residual & \cmd{testuhat} \\
      Panel diagnostics & \cmd{hausman} \\
    \end{tabular}
  \end{center}
\end{table}

\chapter{Options, arguments and path-searching}
\label{optarg}

\section{gretl}
\label{optarg1}

\cmd{gretl} (under MS Windows, \cmd{gretlw32.exe})\footnote{On Linux,
  a ``wrapper'' script named \texttt{gretl} is installed.  This script
  checks whether the \texttt{DISPLAY} environment variable is set; if
  so, it launches the GUI program, \verb@gretl_x11@, and if not it
  launches the command-line program, \texttt{gretlcli}.}  

--- Opens the program and waits for user input.

\cmd{gretl} \textsl{datafile} 

--- Starts the program with the specified datafile in its workspace.
The data file may be in native \app{gretl} format, CSV format, or BOX1
format (see the \emph{Gretl User's Guide}).  The program will try to
detect the format of the file and treat it appropriately. See also
Section \ref{path-search} below for path-searching behavior.
    
\cmd{gretl --help} (or \cmd{gretl -h})  

--- Print a brief summary of usage and exit.
    
\cmd{gretl --version} (or \cmd{gretl -v})

--- Print version identification for the program and exit.
    
\cmd{gretl --english} (or \cmd{gretl -e})

--- Force use of English instead of translation.
    
\cmd{gretl --run} \textsl{scriptfile} (or \cmd{gretl -r}
\textsl{scriptfile})

--- Start the program and open a window displaying the specified
script file, ready to run.  See Section \ref{path-search} below for
path-searching behavior.


\cmd{gretl --db} \textsl{database} (or \cmd{gretl -d}
\textsl{database})

--- Start the program and open a window displaying the specified
database.  If the database files (the \texttt{.bin} file and its
accompanying \texttt{.idx} file) are not in the default system
database directory, you must specify the full path.  See also the
\emph{Gretl User's Guide} for details on databases.
    
\cmd{gretl --dump} (or \cmd{gretl -c})

--- Dump the program's configuration information to a plain text file
(the name of the file is printed on standard output).  May be useful
for trouble-shooting.

Various things in \app{gretl} are configurable under the ``File,
Preferences'' menu.

\begin{itemize}
\item The base directory for \app{gretl}'s shared files.
\item The user's base directory for \app{gretl}-related files.
\item The command to launch \app{gnuplot}.
\item The command to launch GNU R.
\item The command with which to view {\TeX} DVI files.
\item The directory in which to start looking for native \app{gretl}
  databases.
\item The directory in which to start looking for RATS 4 databases.
\item The host name of the \app{gretl} database server to access.
\item The IP number and port number of the HTTP proxy server to use
  when contacting the database server, if applicable (if you're behind
  a firewall).
\item The calculator and editor programs to launch from the toolbar.
\item The monospaced font to be used in \app{gretl} screen output.
\item The font to be used for menus and other messages.  (Note: this
  item is not present when \app{gretl} is compiled for the \app{gnome}
  desktop, since the choice of fonts is handled centrally by
  \app{gnome}.)
\end{itemize}

There are also some check boxes.  Checking the ``expert'' box quells
some warnings that are otherwise issued.  Checking ``Tell me about
gretl updates'' makes \app{gretl} attempt to query the update server
at start-up. Unchecking ``Show gretl toolbar'' turns the icon toolbar
off.  If your native language setting is not English and the local
decimal point character is not the period (``\texttt{.}''), unchecking
``Use locale setting for decimal point'' will make \app{gretl} use the
period regardless.

Finally, there are some binary choices: Under the ``Open/Save path''
tab you can set where \app{gretl} looks by default when you go to open
or save a file --- either the \app{gretl} user directory or the
current working directory.  Under the ``Data files'' tab you can set
the default filename suffix for data files.  The standard suffix is
\texttt{.gdt} but if you wish you can set this to \texttt{.dat}, which
was standard in earlier versions of the program.  If you set the
default to \texttt{.dat} then data files will be saved in the
``traditional'' format (see the \emph{Gretl User's Guide}). Also under
the ``Data files'' tab you can select the action for the little folder
icon on the toolbar: whether it should open a listing of the data
files associated with Ramanathan's textbook, or those associated with
Wooldridge's text.

Under the ``General'' tab you may select the algorithm used by
\app{gretl} for calculating least squares estimates.  The default is
Cholesky decomposition, which is fast, relatively economical in terms
of memory requirements, and accurate enough for most purposes.  The
alternative is QR decomposition, which is computationally more
expensive and requires more temporary storage, but which is more
accurate.  You are unlikely to need the extra accuracy of QR
decomposition unless you are dealing with very ill-conditioned data
and are concerned with coefficient or standard error values to more
than 7 digits of precision.\footnote{The option of using QR
  decomposition can also be activated by setting the environment
  variable \verb@GRETL_USE_QR@ to any non-NULL value.}

Settings chosen in this way are handled differently depending on the
context.  Under MS Windows they are stored in the Windows registry.
Under the \app{gnome} desktop they are stored in \texttt{.gnome/gretl}
in the user's home directory.  Otherwise they are stored in a file
named \texttt{.gretlrc} in the user's home directory.

\section{gretlcli}
\label{optarg2}

\cmd{gretlcli}

--- Opens the program and waits for user input.
    
\cmd{gretlcli} \textsl{datafile}

--- Starts the program with the specified datafile in its workspace.
The data file may be in any format supported by \app{gretl} (see the
\emph{Gretl User's Guide} for details).  The program will try to
detect the format of the file and treat it appropriately. See also
Section \ref{path-search} for path-searching behavior.

\cmd{gretlcli --help} (or \cmd{gretlcli -h})

--- Prints a brief summary of usage.

\cmd{gretlcli --version} (or \cmd{gretlcli -v})

--- Prints version identification for the program.

\cmd{gretlcli --pvalue} (or \cmd{gretlcli -p})

--- Starts the program in a mode in which you can interactively
determine p-values for various common statistics.

\cmd{gretlcli --english} (or \cmd{gretlcli -e})

--- Force use of English instead of translation.

\cmd{gretlcli --run} \textsl{scriptfile} (or \cmd{gretlcli -r}
\textsl{scriptfile})

--- Execute the commands in \textsl{scriptfile} then hand over input
to the command line.  See Section \ref{path-search} for path-searching
behavior.

\cmd{gretlcli --batch} \textsl{scriptfile} (or \cmd{gretlcli -b}
\textsl{scriptfile})

--- Execute the commands in \textsl{scriptfile} then exit.  When using
this option you will probably want to redirect output to a file.  See
Section \ref{path-search} for path-searching behavior.

When using the \cmd{--run} and \cmd{--batch} options, the script file
in question must call for a data file to be opened. This can be done
using the \cmd{open} command within the script.


\section{Path searching}
\label{path-search}

When the name of a data file or script file is supplied to \app{gretl}
or \app{gretlcli} on the command line, the file is looked for as
follows:

\begin{enumerate}
\item ``As is''.  That is, in the current working directory or, if a
  full path is specified, at the specified location.
\item In the user's gretl directory (see Table~\ref{tab-path} for the
  default values).
\item In any immediate sub-directory of the user's gretl directory.
\item In the case of a data file, search continues with the main
  \app{gretl} data directory. In the case of a script file, the search
  proceeds to the system script directory.  See Table~\ref{tab-path}
  for the default settings. (\texttt{PREFIX} denotes the base
  directory chosen at the time \app{gretl} is installed.)
\item In the case of data files the search then proceeds to all
  immediate sub-directories of the main data directory.
\end{enumerate}

\begin{table}[htbp]
\caption{Default path settings}
\label{tab-path}
\begin{center}
\begin{tabular}{lll}
\textit{ } & \textit{Linux} & \textit{MS Windows} \\ [4pt]
User directory & \verb|$HOME/gretl| & \verb|PREFIX\gretl\user| \\
System data directory & \texttt{PREFIX/share/gretl/data} & 
\verb|PREFIX\gretl\data| \\
System script directory & \texttt{PREFIX/share/gretl/scripts} & 
\verb|PREFIX\gretl\scripts| \\
\end{tabular}
\end{center}
\end{table}

Thus it is not necessary to specify the full path for a data or script
file unless you wish to override the automatic searching mechanism.
(This also applies within \app{gretlcli}, when you supply a filename
as an argument to the \cmd{open} or \cmd{run} commands.)

When a command script contains an instruction to open a data file, the
search order for the data file is as stated above, except that the
directory containing the script is also searched, immediately after
trying to find the data file ``as is''.
    
\subsection{MS Windows}
\label{MS-behave}

Under MS Windows configuration information for \app{gretl} and
\app{gretlcli} is stored in the Windows registry.  A suitable set of
registry entries is created when \app{gretl} is first installed, and
the settings can be changed under \app{gretl}'s ``File, Preferences''
menu. In case anyone needs to make manual adjustments to this
information, the entries can be found (using the standard Windows
program \app{regedit.exe}) under \verb|Software\gretl| in
\verb|HKEY_CLASSES_ROOT| (the main \app{gretl} directory and the
command to invoke \app{gnuplot}) and \verb|HKEY_CURRENT_USER| (all
other configurable variables).

