This function implements the two main algorithms used for fitting multivariate generalized linear models to twin data, i.e. The chaser and the reciprocal likelihood algorithms.
Usage
fit_mglm(list_initial, list_link, list_variance,
list_X, list_Z, list_offset, list_Ntrial, list_power_fixed,
y_vec, correct, max_iter, tol, method,
tuning, verbose, weights)
Source
Bonat, W. H. and Jorgensen, B. (2016) Multivariate covariance generalized linear models. Journal of Royal Statistical Society - Series C 65:649–675.
Bonat, W. H. (2018). Multiple Response Variables Regression Models in R: The mcglm Package. Journal of Statistical Software, 84(4):1–30.
Arguments
- list_initial
a list of initial values for regression and covariance parameters.
- list_link
a list specifying the link function names.
Options are:"logit"
,"probit"
,"cauchit"
,"cloglog"
,"loglog"
,"identity"
,"log"
,"sqrt"
,"1/mu^2"
and"inverse"
.
Seemt_link_function
for details. Defaultlink = "identity"
.- list_variance
a list specifying the variance function names. Options are:
"constant"
,"tweedie"
,"poisson_tweedie"
,"binomialP"
and"binomialPQ"
. Seemt_variance_function
for details. Defaultvariance = "constant"
.- list_X
a list of design matrices. See
model.matrix
for details.- list_Z
a list of knowm matrices to compose the matrix linear predictor.
- list_offset
a list of offset values. Default NULL.
- list_Ntrial
a list of number of trials, useful only when analysing binomial data. Default 1.
- list_power_fixed
a list of logicals indicating if the power parameters should be estimated or not. Default
power_fixed = TRUE
.- y_vec
a vector of the stacked response variables.
- correct
a logical indicating if the algorithm will use the correction term or not. Default
correct = FALSE
.- max_iter
maximum number of iterations. Default
max_iter = 20
.- tol
a numeric specyfing the tolerance. Default
tol = 1e-04
.- method
a string specyfing the method used to fit the models (
"chaser"
or"rc"
). Defaultmethod = "chaser"
.- tuning
a numeric value in general close to zero for the rc method and close to 1 for the chaser method. This argument control the step-length. Default
tuning = 1
.- verbose
a logical if TRUE print the values of the covariance parameters used on each iteration. Default
verbose = FALSE
- weights
Vector of weights for model fitting.
Value
A list with estimated regression and covariance parameters.
Details about the estimation procedures as iterations, sensitivity,
variability are also provided. In general the users do not need to
use this function directly. The mglm4twin
provides GLM
interface for fitting multivariate generalized linear models for twin data.
Author
Wagner Hugo Bonat, wbonat@ufpr.br