Model Validation 441
β
, we need the first and second partial derivatives of logb
θ
(u) with respect to
α
and
β
. There are
two ways to do this. The first is to write functions by hand which evalua te the par tial derivatives,
and pass them to leverage.ppm, influence.ppm, and dfbetas.ppm as the arguments iScore
and iHessian. The second way is to use th e symb olic calculus features of R.
The first strategy involves differentiatin g logb
θ
(u) and coding the result by ha nd. Using the
function d2incin defined o n page 363, the components of the score are
> Zalpha <- function(x,y, alpha, beta) {
expbit <- exp( - beta * d2incin(x,y))
expbit/(1 + alpha * expbit)
}
> Zbeta <- function(x,y, alpha, beta) {
d2 <- d2incin(x,y)
topbit <- alpha * exp( - beta * d2)
- d2 * topbi ...