glmm_FA: Fit a Generalized Mixed Model via Monte Carlo Expectation...

View source: R/glmmPen_FA.R

glmm_FAR Documentation

Fit a Generalized Mixed Model via Monte Carlo Expectation Conditional Minimization (MCECM)

Description

glmm_FA is used to fit a single generalized linear mixed model via Monte Carlo Expectation Conditional Minimization (MCECM) using a factor model decomposition of the random effects. No model selection is performed. This function uses a factor model decomposition on the random effects. This assumption reduces the latent space in the E-step (Expectation step) of the algorithm, which reduces the computational complexity of the algorithm. This improves the speed of the algorithm and enables the scaling of the algorithm to larger dimensions. Besides the modeling of the random effects, this function is similar to glmm.

Usage

glmm_FA(
  formula,
  data = NULL,
  family = "binomial",
  offset = NULL,
  r_estimation = rControl(),
  optim_options = optimControl(),
  adapt_RW_options = adaptControl(),
  trace = 0,
  tuning_options = lambdaControl(),
  progress = TRUE,
  ...
)

Arguments

formula

a two-sided linear formula object describing both the fixed effects and random effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. Random-effects terms are distinguished by vertical bars ("|") separating expression for design matrices from the grouping factor. formula should be of the same format needed for glmer in package lme4. Only one grouping factor will be recognized. The random effects covariates need to be a subset of the fixed effects covariates. The offset must be specified outside of the formula in the 'offset' argument.

data

an optional data frame containing the variables named in formula. If data is omitted, variables will be taken from the environment of formula.

family

a description of the error distribution and link function to be used in the model. Currently, the glmmPen algorithm allows the Binomial ("binomial" or binomial()), Gaussian ("gaussian" or gaussian()), and Poisson ("poisson" or poisson()) families with canonical links only. See phmmPen for variable selection within proportional hazards mixed models for survival data.

offset

This can be used to specify an a priori known component to be included in the linear predictor during fitting. Default set to NULL (no offset). If the data argument is not NULL, this should be a numeric vector of length equal to the number of cases (the length of the response vector). If the data argument specifies a data.frame, the offset argument should specify the name of a column in the data.frame.

r_estimation

a list of class "rControl" from function rControl containing the control parameters for the estimation of the number of latent factors to use in the glmmPen_FA and glmm_FA estimation procedures.

optim_options

a structure of class "optimControl" created from function optimControl that specifies several optimization parameters. See the documentation for optimControl for more details on defaults.

adapt_RW_options

a list of class "adaptControl" from function adaptControl containing the control parameters for the adaptive random walk Metropolis-within-Gibbs procedure. Ignored if optimControl parameter sampler is set to "stan" (default) or "independence".

trace

an integer specifying print output to include as function runs. Default value is 0. See Details for more information about output provided when trace = 0, 1, or 2.

tuning_options

a list of class "selectControl" or "lambdaControl" resulting from selectControl or lambdaControl containing additional control parameters. When function glmm is used,the algorithm may be run using one specific set of penalty parameters lambda0 and lambda1 by specifying such values in lambdaControl(). The default for glmm is to run the model fit with no penalization (lambda0 = lambda1 = 0). When function glmmPen is run, tuning_options is specified using selectControl(). See the lambdaControl and selectControl documentation for further details.

progress

a logical value indicating if additional output should be given showing the progress of the fit procedure. If TRUE, such output includes iteration-level information for the fit procedure (iteration number EM_iter, number of MCMC samples nMC, average Euclidean distance between current coefficients and coefficients from t–defined in optimControl–iterations back EM_conv, and number of non-zero fixed and random effects covariates not including the intercept). Additionally, progress = TRUE gives some other information regarding the progress of the variable selection procedure, including the model selection criteria and log-likelihood estimates for each model fit. Default is TRUE.

...

additional arguments that could be passed into glmmPen_FA. See glmmPen_FA for further details (e.g. arguments related to variable selection that could be used to fit a single penalized GLMM model).

Details

The glmm_FA function can be used to fit a single generalized linear mixed model. While this approach is meant to be used in the case where the user knows which covariates belong in the fixed and random effects and no penalization is required, one is allowed to specify non-zero fixed and random effects penalties using lambdaControl and the (...) arguments. The (...) allow for specification of penalty-related arguments; see glmmPen_FA for details. For a high dimensional situation, the user may want to fit a full model using a small penalty for the fixed and random effects and save the posterior draws from this full model for use in any BIC-ICQ calculations during selection within glmmPen_FA. Specifying a file name in the 'BICq_posterior' argument will save the posterior draws from the glmm_FA model into a big.matrix with this file name, see the Details section of glmmPen_FA for additional details.

Value

A reference class object of class pglmmObj for which many methods are available (e.g. methods(class = "pglmmObj"))


hheiling/glmmPen documentation built on Jan. 15, 2024, 11:47 p.m.