# mkdevfun

From lme4 v1.1-13
by Ben Bolker

##### Create Deviance Evaluation Function from Predictor and Response Module

From a ```
object create an R function that
takes a single argument, which is the new parameter value, and
returns the deviance.
```

- Keywords
- models

##### Usage

`mkdevfun(rho, nAGQ = 1L, maxit = 100, verbose = 0, control = list())`

##### Arguments

- rho
- an environment containing
`pp`

, a prediction module, typically of class`and`

`resp`

, a response module, e.g., of class`.`

- nAGQ
- scalar integer - the number of adaptive Gauss-Hermite quadrature points. A value of 0 indicates that both the fixed-effects parameters and the random effects are optimized by the iteratively reweighted least squares algorithm.
- maxit
- scalar integer, currently only for GLMMs: the maximal number of Pwrss update iterations.
- verbose
- scalar logical: print verbose output?
- control
- list of control parameters, a subset of
those specified by
`lmerControl`

(`tolPwrss`

and`compDev`

for GLMMs,`tolPwrss`

for NLMMs)

##### Details

The function returned by `mkdevfun`

evaluates the
deviance of the model represented by the predictor
module, `pp`

, and the response module, `resp`

. For `lmer`

model objects the argument of the
resulting function is the variance component parameter,
`theta`

, with lower bound. For `glmer`

or
`nlmer`

model objects with `nAGQ = 0`

the
argument is also `theta`

. However, when nAGQ > 0,
the argument is `c(theta, beta)`

.

##### Value

A `function`

of one numeric argument.

##### See Also

##### Examples

```
(dd <- lmer(Yield ~ 1|Batch, Dyestuff, devFunOnly=TRUE))
dd(0.8)
minqa::bobyqa(1, dd, 0)
```

*Documentation reproduced from package lme4, version 1.1-13, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.