7.4 Options
- opt =
glmopt
(string1, value1, ... {, opt})
- creates a list of options for GLM estimation or appends options
to an existing list
|
Options for the algorithm and optional parameters should be
collected in a list object. This allows us to set or to modify
those options which are necessary. Almost all functions in the
glm
library allow options. It is possible
to give the same list of options to different functions. For example,
opt=glmopt("miter",20,"name","MyDisplay")
will set the maximal number of iteration to 20 and the name of the output
display to MyDisplay. Now, one can call first
glmest
and then
glmout
with the list opt:
l=glmest("bilo",x,y,opt)
glmout("bilo",x,y,l.b,l.bv,l.stat,opt)
Both
glmest
and
glmout
only consider those
optional parameters which are intended for them. Hence
glmest
will only care about miter and
glmout
will present a display with the title MyDisplay.
7.4.1 Setting Options
Principally, it is possible to define the list of optional parameters with
the
XploRe
command list.
However, it is recommended to use the
glmopt
tool
to set the options. The first call of
glmopt
will create a list of options. To append a further component
to opt, we have to repeat the name
opt as the last argument of
glmopt
. For example,
opt=glmopt("miter",20,"title","MyDataset")
opt=glmopt("name","MyDisplay",opt)
creates the list opt with a component miter containing
the value 20, a component title containing the string
"MyDataset" and a component name containing the string
"MyDisplay".
The resulting list has three components as one can check with
names(opt).
The next sections will explain which options can be used
in GLM estimation.
7.4.2 Weights and Offsets
Prior weights and offsets can always be given as an optional parameter.
The corresponding components of the list of optional parameters are
- wx
- weights, nx1 vector or scalar. Default is wx=1.
- off
- offset, nx1 vector or scalar. Default is off=1.
Neither of both parameters should contain missing or infinite values.
7.4.3 Control Parameters
There is a number of control parameters which modify the used algorithm:
- cnv
- convergence criterion. The iteration stops when the relative change of
the coefficients vector b or the relative change in deviance is
less than cnv. Default is cnv=0.0001. This parameter
is ignored in noniterative estimation (model code "noid").
- miter
- maximal number of iterations. The iteration stops when this maximal number
of iterations is reached. Default is miter=10. This parameter
is ignored in noniterative estimation (model code "noid").
- fscor
- indicator for Fisher scoring (instead of Newton-Raphson optimization).
fscor=1
means that the Fisher scoring is used. Default is fscor=0 for
Newton-Raphson. This parameter is ignored for canonical link
functions.
- norepl
- norepl=1 forces not to search for replications in x. Default is
norepl=0, i.e. to search for replications.
The following parameters switch on/off information during the computation.
- shf
- shows how the iteration proceeds, if shf=1 set. Default is
shf=0.
- shm
- shows how the model selection proceeds, if shm=1 set. Default
is shm=0. This parameter is only recognized for model selection.
The model selection functions
glmselect
,
glmforward
and
glmbackward
also provide two extra parameters:
- crit
- single string, "aic" or "bic" for Akaike or Schwarz criterion
to use in model selection.
- fix
- indicates which columns in x are held fixed in model selection.
7.4.4 Output Modification
Functions which provide graphical output (
glmout
,
glmplot
,
doglm
) accept special options to
change output.
- nopic
- suppresses output display in
glmout
or
doglm
,
if nopic=1. Default is nopic=0.
- xvars
- string vector, containing variable names for the columns
of x.
- name
- single string, name for output and prefix for output displays.
- title
- single string, title to be used in
glmout
or
doglm
.