Estimates structured dispersion effects using approximate REML with gamma responses.
remlscoregamma(y,X,Z,mlink="log",dlink="log",trace=FALSE,tol=1e-5,maxit=40)
numeric vector of responses
design matrix for predicting the mean
design matrix for predicting the variance
character string or numeric value specifying link for mean model
character string or numeric value specifying link for dispersion model
Logical variable. If true then output diagnostic information at each iteration.
Convergence tolerance
Maximum number of iterations allowed
List with the following components:
Vector of regression coefficients for predicting the mean
<Standard errors for beta
Vector of regression coefficients for predicting the variance
Standard errors for gamma
Estimated means
Estimated dispersions
Minus twice the REML log-likelihood
Leverages
Write
Parameters are estimated by maximizing the REML likelihood using REML scoring as described in Smyth and Verbyla (2001). See also Smyth and Verbyla (1999a,b).
Smyth, G. K., and Verbyla, A. P. (1999a). Adjusted likelihood methods for modelling dispersion in generalized linear models. Environmetrics 10, 695-709. http://www.statsci.org/smyth/pubs/ties98tr.html
Smyth, G. K., and Verbyla, A. P. (1999b). Double generalized linear models: approximate REML and diagnostics. In Statistical Modelling: Proceedings of the 14th International Workshop on Statistical Modelling, Graz, Austria, July 19-23, 1999, H. Friedl, A. Berghold, G. Kauermann (eds.), Technical University, Graz, Austria, pages 66-80. http://www.statsci.org/smyth/pubs/iwsm99-Preprint.pdf
Smyth, GK, and Verbyla, AP (2009). Leverage adjustments for dispersion modelling in generalized nonlinear models. Australian and New Zealand Journal of Statistics 51, 433-448.
# NOT RUN {
data(welding)
attach(welding)
y <- Strength
X <- cbind(1,(Drying+1)/2,(Material+1)/2)
colnames(X) <- c("1","B","C")
Z <- cbind(1,(Material+1)/2,(Method+1)/2,(Preheating+1)/2)
colnames(Z) <- c("1","C","H","I")
out <- remlscoregamma(y,X,Z)
# }
Run the code above in your browser using DataLab