Forms D-optimal designs to estimate the parameters of a nonlinear or generalized linear model (W. van den Berg).
|Controls printed output (
||Controls whether to plot the design (
||Data structure that stores the results of the function when it is calculated by expressions supplied by the
||Data structure representing the x-variate in the expressions supplied by the
||Specifies the function whose parameters are to be estimated; must be set|
||Specifies expressions to calculate derivative of the function with respect to each parameter; must be set|
||Data structure that stores the iterative weights in the expressions supplied by the
||Specifies expressions to calculate the iterative weights when estimating the parameters of a generalized linear model|
||Supplies the support points for the initial design, and saves those of the final design; if no initial values are supplied, an initial design is formed at random|
||Supplies the weights for the support points for the initial design, and saves those of the final design; if no initial values are supplied, equal weights are used initially|
||Specifies the grid points where the design will be evaluated|
||Initial update weight; default 0.1|
||Seed for the random numbers used to select the initial design when not supplied by
||Number of iterations to make between at each value of
||Maximum number of iterations; default 2500|
||Variate with two values specifying the convergence criterion and the tolerance for zero weights; default
||Parameters of the nonlinear or generalized linear model (with values giving an indication of their likely estimated values)|
||Data structures that store the results of the calculation of the derivative for each parameter, in the expressions specified by the
AFNONLINEAR constructs a design for estimating the parameters of a nonlinear or generalized linear model involving a single continuous variable x. The aim is to find the best values of x (i.e. the best support points) at which to observe the model, and a weight for each one. The design should then contain replicate observations at each of the support points, with the numbers of replicates in the same proportions as their weights. Suppose, for example, we have support points 1, 2 and 4, with weights 0.25, 0.25 and 0.5. A suitable design might then consist of observations at x-values 1, 2, 4 and 4 (i.e. 4 should have twice the replication of either 1 or 2). The designs that are produced are known as continuous designs, as the weights are not constrained to give an exact integer partitioning of the available points for any specific design size N. Instead you need to round N multiplied by each weight to the nearest feasible integer.
The model is specified in one, or more, expression structures by the
FUNCTION option. The
YARGUMENT gives the identifier of the data structure that receives the result of the function in the expressions, and the
XARGUMENT gives the identifier of the data structure that provides the x-values. For example, we could define the negative exponential model
y = e(-b × x) + c
EXPRESSION Func; VALUE=!e( Y = EXP(-1*B*X) + C)
AFNONLINEAR [FUNCTION=Func; YARGUMENT=Y; XARGUMENT=X; ...
Notice that the data structures X and Y do not need to be declared.
AFNONLINEAR simply needs to know which they are within the expression, so that it can replace them by the sets of x– and y-values that it really needs (using the
The parameters of the model (here
C) must be specified by the
PARAMETER parameter. These must be scalars, with values that give an indication of their likely estimated values.
AFNONLINEAR also needs to be able to calculate the derivative of the function with respect to each parameter. You must specify expressions to do this using the
FNDERIVATIVES option, and indicate the data structures that will receive the results of the calculations using the
DERIVATIVE parameter. So, for the negative exponential above, we need
EXPRESSION Gfunc[1,2]; VALUE=!e( GradB = -1*X*EXP(-1*B*X) ),\
!e( GradC = 1 )
AFNONLINEAR [FUNCTION=Function; YARGUMENT=Y; XARGUMENT=X;\
FNDERIVATIVE=Gfunc; XSUPPORT=X; XWEIGHTS=W;\
GRID=Grid] PARAMETER=B,C; DERIVATIVE=GradB,GradC
GRID option defines the x-values at which the design is evaluated. These should cover the range of feasible x-values.
XSUPPORT option saves the support points of the design, in a variate. If the variate has values already defined on entry to
AFNONLINEAR, these are used to provide the support points for the initial design where
AFNONLINEAR begins its search. Otherwise
AFNONLINEAR chooses an initial design at random by selecting m points at random from the grid points, where m is twice the number of parameters in the model. The
SEED option specifies a seed for the random numbers that are used to make the selection. The default value of zero continues an existing sequence of random numbers if any have already been used in the current Genstat job, or obtains a random seed using system clock if none have been used already.
XWEIGHTS option saves the weights of the support points, in a variate, and can supply weights for an initial design. Otherwise
AFNONLINEAR starts with equal weights.
To form designs for generalized linear models, you also need to supply expressions to calculate the iterative weights at various x-values. The
FNITERATIVEWEIGHTS option supplies the expressions, and the
ITERATIVEWEIGHTS option indicate the data structure that will receive the results of the calculations.
AFNONLINEAR produces a plot showing the function and prediction variance at the selected grid points, but you can suppress this by setting option
AFNONLINEAR uses the algorithm of Federov (1972). This involves a sequence of iterations in which a new support point may be added, or the weight of an existing point may be increased. The
A0 option specifies the weights to be given to a new point, or to be added to an existing point. (The weights of the other support points are then decreased, proportionally, so that the weights still add up to one.) The
NCYCLE option controls how many iterations are made with each value of
AO (default 100); so, at the end of each set of
AO is divided by two in order for the weights to converge to a stable solution.
TOLERANCES option can be set to a variate of length two, to specify the convergence criterion and the tolerance for zero weights (defaults 10-6 and 10-5, respectively). The algorithm stops when the number of support points equals the number of parameters, and the prediction variance minus the number of parameters is less than the first
TOLERANCES value. Weights less than the second
TOLERANCES value are set to zero at each iteration (so that the corresponding points leave the design).
For a D-optimal design the number of support points is equal to the number of parameters, and the determinant of the information matrix is at its maximum. Instead of maximizing the information matrix,
AFNONLINEAR uses the General Equivalence Theorem. By minimizing the maximum prediction variance of the response a G-optimal design is obtained, with the maximum prediction variance of the response equal to the number of parameters and occurring at the support points. According to the General Equivalence Theorem the design will also be D-optimal.
Fedorov (1972) proposes starting with a value for
A0 of e.g. 0.1, and dividing
A0 by two after each iteration so that the determinant of the information matrix is lower than the determinant of the information matrix of the preceding iteration.
AFNONLINEAR allows you to set the initial value of
A0 default 0.1), and the number of iterations to make before dividing it by two (option
NCYCLE, default 100).
Sometimes the weight of a support point may be divided over two neighbouring points of the grid, and the algorithm may fail to converge. In that case you could replace the two support points by a new point with a weight equal to the total of their two weights, and located at their average. Alternatively, you could change the
SEED option to run
AFNONLINEAR again from a different starting design.
Fedorov, V.V. (1972). Theory of Optimal Experiments. Academic Press, New York & London.
Commands for: Design of experiments.
CAPTION 'AFNONLINEAR example'; STYLE=meta VARIATE [VALUES=3,4] X VARIATE [VALUES=0.6,0.4] W VARIATE [VALUES=0,0.1... 5] Grid SCALAR B,C; VALUE=1,5 EXPRESSION Function; VALUE=!e( Y = EXP(-1*B*X) + C ) EXPRESSION Gfunction[1,2]; VALUE=!e( GradB = -1*X*EXP(-1*B*X) ),\ !e( GradC = 1 ) AFNONLINEAR [FUNCTION=Function; YARGUMENT=Y; XARGUMENT=X;\ FNDERIVATIVE=Gfunction; XSUPPORT=X; XWEIGHTS=W; GRID=Grid]\ PARAMETER=B,C; DERIVATIVE=GradB,GradC