Calculates the weight matrix in the pseudo iterative reweighted least squares step of a generalized linear model. It is based on the variance function and the first derivative of the link function. The values are calculated at the actual expected values. The dimension of the matrix is n x n (n = number of observations). For details see reference.
calcWdiag(varMu, gDerivMu)
Value of the variance function of the exponential family on the expected value mu (numeric scalar).
Value of the first derivative of the link function evaluated at the expected value. (numeric scalar).
Weight matrix (numeric vector).
Simon N. Wood, (2006), Generalized Additive Models: An Introduction with R, Taylor \& Francis Group LLC