Defines nonlinear parameters for the fixed model of a hierarchical generalized linear model (R.W. Payne, Y. Lee, J.A. Nelder & M. Noh).

### Options

`CALCULATION` = expression structures |
Calculation of explanatory variates involving nonlinear parameters |
---|---|

`METHOD` = string token |
Algorithm for fitting the nonlinear model (`GaussNewton` , `NewtonRaphson` , `FletcherPowell` ); default `Gaus` |

`VECTORS` = variates |
Vectors involved in the calculations (data vectors or factors or derived vectors that appear in the fixed model) |

### Parameters

`PARAMETER` = scalars |
Nonlinear parameters in the model |
---|---|

`LOWER` = scalars |
Lower bound for each parameter |

`UPPER` = scalars |
Upper bound for each parameter |

`STEPLENGTH` = scalars |
Initial step length for each parameter |

`INITIAL` = scalars |
Initial value for each parameter |

`DELTA` = scalars |
Parameter increment to use when calculating numerical derivatives |

### Description

`HGNONLINEAR`

is one of several procedures with the prefix HG, which provide tools for fitting the hierarchical generalized linear models defined by Lee & Nelder (1996, 2001, 2006) and described by Lee, Nelder & Pawitan (2006). These models extend generalized linear models (GLMs) to include additional random terms in the linear predictor. They include generalized linear mixed models (GLMMs) as a special case, but do not constrain the additional terms to follow a Normal distribution and to have an identity link (as in the GLMM). For example, if the basic generalized linear model is a log-linear model (Poisson distribution and log link), a more appropriate assumption for the additional random terms might be a gamma distribution and a log link.

`HGNONLINEAR`

allows you to extend a conjugate HGLM to become a hierarchical generalized nonlinear model by including nonlinear parameters in the fixed model (Payne 2014). This is done exactly as in a generalized nonlinear model (see *Guide to the Genstat Command Language*, Part 2 Section 3.5.8), by defining some calculations to form variates to include as linear terms in the model. So the nonlinear terms have the form

*B* × f(*p*)

where *B* is a (linear) regression coefficient and f() is a function of some nonlinear parameters e.g.

*B* × *R ^{X}*

defines an exponential term with nonlinear parameter *R*. (This can be written as exp(*k* × *X*) where the *R* = exp(*k*).)

The calculations are specified, as a list of Genstat expression structures, by the `CALCULATION`

option. (This corresponds to the `CALCULATION`

option of the `FIT`

directive.) You must also use the `VECTORS`

option to list the vectors that appear in the calculations (either as data vectors or as derived vectors that then appear as linear terms in the fixed model). The `METHOD`

option indicates which algorithm to use to fit the nonlinear model. (This corresponds to the `METHOD`

option of the `RCYCLE`

directive.)

The parameters of `HGNONLINEAR`

supply information about the nonlinear parameters. Most of these correspond to parameters in the `RCYCLE`

directive. `PARAMETER`

lists the identifiers of the parameters as they appear in the calculations. `LOWER`

and `UPPER`

can define lower and upper bounds. `STEPLENGTH`

can define the step lengths to use for each parameter at the start of the optimization, and `INITIAL`

can define initial values. Genstat will take default initial values if you do not specify these yourself. However, these may not lead to convergence, so you are strongly advised to specify your own. It is often feasible to fit the models in an ordinary generalized nonlinear model, with the random terms included as fixed terms, and then use those estimates as the initial values for the hierarchical generalized nonlinear model.

The final parameter, `DELTA`

, specifies a small increment to each parameter to be used inside the algorithm when calculating derivatives of the fixed model with respect to each nonlinear parameter (needed to calculate leverages).

Options: `CALCULATION`

, `METHOD`

, `VECTORS`

.

Parameters: `PARAMETER`

, `LOWER`

, `UPPER`

, `STEPLENGTH`

, `INITIAL`

, `DELTA`

.

### Method

The information is stored in a workspace `'G5PL_HG'`

(accessed using the `WORKSPACE`

directive) for later use by `HGANALYSE`

.

### References

Lee, Y. & Nelder, J.A. (1996). Hierarchical generalized linear models (with discussion). *Journal of the Royal Statistical Society Series B*, 58, 619-678.

Lee, Y. & Nelder, J.A. (2001). Hierarchical generalized linear models: a synthesis of generalised linear models, random-effect models and structured dispersions. *Biometrika*, 88, 987-1006.

Lee, Y. & Nelder, J.A. (2006). Double hierarchical generalized linear models (with discussion). *Appl. Statist.*, 55, 1-29.

Lee, Y., Nelder, J.A. & Pawitan, Y. (2006). *Generalized Linear Models with Random Effects: Unified Analysis via H-likelihood*. Chapman and Hall, Boca Raton.

Payne, R.W. (2014). Hierarchical generalized nonlinear models. In: *Statistical Modelling in Biostatistics and Bioinformatics* (ed. G. MacKenzie & D. Peng), 111-124. Springer, New York.

### See also

Procedures: `HGANALYSE`

, `HGDISPLAY`

, `HGDRANDOMMODEL`

, `HGFIXEDMODEL`

, `HGFTEST`

, `HGGRAPH`

, `HGKEEP`

, `HGPLOT`

, `HGPREDICT`

, `HGRANDOMMODEL`

, `HGRTEST`

, `HGSTATUS`

, `HGWALD`

.

Commands for: Regression analysis.

### Example

CAPTION 'HGNONLINEAR example',!t(\ 'A rotational experiment with plots having a range of soil',\ 'phosphate levels provides measurements of weight of beet,',\ '%sugar in the beet and soil phosphate level in each of four',\ 'successive years.'); STYLE=meta,plain READ Beetwt,%sugar,SoilP 7.23 18.5 5.4 7.69 18.0 5.4 24.64 20.1 7.8 26.67 19.8 8.0 39.78 19.5 18.0 44.98 19.3 15.6 41.59 19.7 30.4 44.08 19.8 33.8 48.37 19.4 50.4 44.76 19.0 51.0 49.73 18.6 44.0 51.54 18.5 40.2 47.69 19.0 57.2 45.66 19.4 65.0 50.18 18.6 27.0 47.69 18.7 30.0 8.82 13.8 5.6 1.81 13.9 4.8 15.82 14.5 10.2 9.04 14.0 8.6 24.41 15.0 21.6 22.60 14.1 17.2 26.45 15.2 36.4 20.80 15.3 37.2 28.30 14.2 44.4 22.60 14.7 44.4 14.24 13.5 41.0 35.94 15.6 30.2 25.54 15.8 60.8 27.13 15.6 47.0 31.42 15.6 27.0 34.13 15.4 29.0 19.90 16.1 3.0 20.60 16.0 2.0 34.70 16.7 6.2 35.40 16.4 6.2 46.80 17.1 19.8 40.50 16.9 17.2 43.00 16.9 29.6 48.60 17.1 28.0 47.30 17.0 42.8 41.30 17.1 46.2 44.30 17.0 36.6 47.60 16.6 40.0 45.60 17.0 42.2 44.60 17.0 52.0 44.00 17.2 23.4 40.10 16.6 28.0 14.35 16.1 4.0 14.35 15.5 3.8 26.71 16.6 8.0 25.12 16.4 6.4 33.39 17.2 18.2 33.79 16.2 14.8 36.68 17.0 35.0 33.69 16.8 29.6 34.98 17.0 37.2 35.78 17.0 40.0 42.06 17.2 39.6 38.77 17.3 36.8 40.66 17.3 52.4 37.28 17.2 45.6 34.68 17.3 22.0 32.59 17.2 26.0 : FACTOR [LEVELS=4; VALUES=16(1...4)] Year CALCULATE Sugar = Beetwt * %sugar / 100 HGRANDOMMODEL [DISTRIBUTION=normal; LINK=identity] Year HGFIXEDMODEL [DISTRIBUTION=normal; LINK=identity] RxxSoilP EXPRESSION [VALUE=(RxxSoilP=R**SoilP)] CalcRxxSoilp SCALAR R; VALUE=0.95 CALCULATE #CalcRxxSoilp HGNONLINEAR [CALCULATION=CalcRxxSoilp; VECTORS=RxxSoilP,SoilP]\ R; INITIAL=0.95; UPPER=1; STEP=0.01 HGANALYSE [PRINT=model,fixed,random,dispersion,likelihood,\ monitoring] Sugar