mt_initial_values: Automatic Initial Values

View source: R/mt_initial_values.R

mt_initial_valuesR Documentation

Automatic Initial Values

Description

This function provides initial values to be used when fitting multivariate generalized linear models by using the function fit_mglm. In general the users do not need to use this function, since it is already employed when setting the argument control_initial = "automatic" in the mglm4twin function. However, if the users want to change some of the initial values, this function can be useful.

Usage

mt_initial_values(linear_pred, matrix_pred, link, variance,
                         offset, Ntrial, contrasts, data)

Arguments

linear_pred

a list of formula see formula for details.

matrix_pred

a list of known matrices to be used on the matrix linear predictor.
See mt_matrix_linear_predictor for details.

link

a list of link functions names, see mglm4twin for details.

variance

a list of variance functions names, see mglm4twin for details.

offset

a list of offset values if any.

Ntrial

a list of the number of trials on Bernoulli experiments. It is useful only for "binomialP" and "binomialPQ" variance functions.

contrasts

list of contrasts to be used in the model.matrix.

data

data frame.

Details

To obtain initial values for multivariate covariance generalized linear models the function
mt_initial_values fits a generalized linear model (GLM) using the function glm with the specified linear predictor and link function for each response variables considering independent observations. The family argument is always specified as quasi. The link function depends on the specification of the argument link. The variance function is always specified as "mu" the only excession appears when using variance = "constant" then the family argument in the glm function is specified as quasi(link = link, variance = "constant"). The estimated value of the dispersion parameter from the glm function is used as initial value for the first component of the matrix linear predictor, for all other components the value zero is used. The value of the power parameter is always started at 1. In the cases of multivariate models the correlation between response variables is always started at 0.

Value

Return a list of initial values to be used while fitting in the mglm4twin function.

Author(s)

Wagner Hugo Bonat, wbonat@ufpr.br


wbonat/mglm4twin documentation built on Oct. 14, 2023, 9:37 p.m.