mmrr: Fit mixed-type multivariate response regression

Description Usage Arguments Value

View source: R/fit-model.R

Description

Fit mixed-type multivariate response regression

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
mmrr(
  Y,
  X,
  type,
  psi = rep(1, ncol(Y)),
  M,
  tol = rep(1e-08, 4),
  maxit = rep(500, 4),
  quiet = rep(TRUE, 4),
  relative = TRUE,
  pgd = TRUE,
  eps = 0,
  uni_fit = FALSE,
  Beta,
  Sigma,
  W,
  w_pen
)

Arguments

Y

An n x r matrix of responses.

X

An nr x p matrix of predictors or a list of length r whose ith element is an n x p_i design matrix for the ith response.

type

An r-vector indicating response types: 1 means Normal, 2 means Bernoulli, and 3 means (quasi-)Poisson.

psi

An r-vector of conditional variance parameters.

M

An r x r matrix with restrictions for Sigma, with NA for unrestricted.

tol

A 4-vector with tolerances for termination of: [1] overall algorithm, [2] update of Beta and Sigma with W fixed, [3] update of Sigma, and [4] update of W.

maxit

A 4-vector with maximum number of iterations for the same steps as the tol vector.

quiet

A 4-vector indicating whether to print information for the same steps as the tol vector.

relative

If TRUE, use relative decrease of parameters to determine convergence, otherwise use absolute.

pgd

If TRUE, use projected gradient descent; ensures SPSD Sigma.

eps

Lower bound for the smallest eigenvalue of Sigma, only used if pgd = TRUE.

uni_fit

If TRUE, fit r separate models. This requires (i) X is a list or (ii) X is a matrix and r is a divisor of p. If (ii), it is assumed that the first p / r columns of X correspond to the first response, and so on.

Beta

Initial iterate of regression coefficient vector. Either a p-vector or a list of length r, where each element is the coefficient vector for the ith response. Is obtained by fitting separate GLMs if not supplied.

Sigma

An r x r initial iterate for the latent covariance matrix. Is set to diag(1e-3, ncol(Y)) if not supplied.

W

An n x r initial iterate for the expansion points. Is set to matrix(X supplied.

w_pen

Ridge penalty in W update; often useful to avoid overflows. Defaults to largest eigenvalue of current Sigma iterate if not supplied.

Value

A list of final iterates and other information about the fit.


koekvall/lvmmr documentation built on Dec. 13, 2021, 2:35 p.m.