| Title: | Matrix-Variate Non-Gaussian Linear Regression Models |
|---|---|
| Description: | An implementation of the expectation conditional maximization (ECM) algorithm for matrix-variate variance gamma (MVVG) and normal-inverse Gaussian (MVNIG) linear models. These models are designed for settings of multivariate analysis with clustered non-uniform observations and correlated responses. The package includes fitting and prediction functions for both models, and an example dataset from a periodontal on Gullah-speaking African Americans, with responses in 'gaad_res', and covariates in 'gaad_cov'. For more details on the matrix-variate distributions used, see Gallaugher & McNicholas (2019) <doi:10.1016/j.spl.2018.08.012>. |
| Authors: | Samuel Soon [aut, cre], Dipankar Bandyopadhyay [aut], Qingyang Liu [aut] |
| Maintainer: | Samuel Soon <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-25 09:19:00 UTC |
| Source: | https://github.com/soonsk-vcu/mvngmod |
These data sets describe periodontal measurements performed on members of the Gullah-Speaking African American community.
gaad_covgaad_cov
Each is a list of matrices, with rows denoting tooth sites and columns denoting CAL/PPD response.
gaad_res and gaad_cov contain the response and covariate matrices of the GAAD data.
gaad_cov gaad_resgaad_cov gaad_res
These data sets describe periodontal measurements performed on members of the Gullah-Speaking African American community.
gaad_resgaad_res
Each is a list of matrices, with rows denoting tooth sites and columns denoting CAL/PPD response.
gaad_res and gaad_cov contain the response and covariate matrices of the GAAD data.
gaad_cov gaad_resgaad_cov gaad_res
This is an example of the format of input parameter list theta.
gaad_theta_mvvggaad_theta_mvvg
List of model parameters.
gaad_theta_mvvggaad_theta_mvvg
This function fits MVNIG linear models for matrix-variate skew data with non-uniform data rows between subjects. Exchangeable observation row correlation and skewness structures are imposed to accommodate the varying row counts across matrices. Note that multiple restarts may be needed to account for unstable local maxima.
MVNIGmod(Y, X, theta_g = NULL, stopping = 0.001, max_iter = 50)MVNIGmod(Y, X, theta_g = NULL, stopping = 0.001, max_iter = 50)
Y |
List of |
X |
List of |
theta_g |
List of parameters to pass as initial values in the AECM algorithm. If NULL, will be randomly generated. See Details for an in-depth explanation. |
stopping |
Stopping threshold for the L-infinity norm of differences in consecutive parameter space, evaluated at iteration |
max_iter |
Maximum number of iterations, default is 50. |
Fits the matrix-variate skew regression model
where each response is a matrix that indexes observations and response variables. corresponds to a design matrix, and corresponds to a coefficient matrix. corresponds to a error matrix, following a matrix-variate variance-gamma distribution.
The model estimates MVVG parameters using the alternating expectation conditional maximization (AECM) algorithm, using the density
where , ,
, , and is the modified Bessel function of the second kind.
The structure of theta_g and parameter estimates returned by the function must be in the form of a list with the following named elements:
Theta: coefficient matrix
a: skewness vector
rho: Compound symmetry parameter for row correlation matrix
Psi: column covariance matrix
tgamma: Univariate mixing parameter
MVNIGmod returns a list with the following elements:
Iteration: Number of iterations taken to convergence. Inf if convergence not reached.
Starting Value: List of initial parameter values.
Final Value: List of final parameter estimates.
Stopping Criteria: Vector of at each iteration.
AIC: Model AIC
BIC: Model BIC
Samuel Soon
Dipankar Bandyopadhyay
Qingyang Liu
MVNIGmod(Y,X,theta_mvnig) set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_mvnig_theta <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), tgamma = 3) MVNIGmod(gaad_res[1:10], gaad_cov[1:10], initial_mvnig_theta)MVNIGmod(Y,X,theta_mvnig) set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_mvnig_theta <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), tgamma = 3) MVNIGmod(gaad_res[1:10], gaad_cov[1:10], initial_mvnig_theta)
This function fits MVVG linear models for matrix-variate skew data with non-uniform data rows between subjects. Exchangeable observation row correlation and skewness structures are imposed to accommodate the varying row counts across matrices. Note that multiple restarts may be needed to account for unstable local maxima.
MVVGmod(Y, X, theta_g = NULL, stopping = 0.001, max_iter = 50)MVVGmod(Y, X, theta_g = NULL, stopping = 0.001, max_iter = 50)
Y |
List of |
X |
List of |
theta_g |
List of parameters to pass as initial values in the AECM algorithm. If NULL, will be randomly generated. See Details for an in-depth explanation. |
stopping |
Stopping threshold for the L-infinity norm of differences in consecutive parameter space, evaluated at iteration |
max_iter |
Maximum number of iterations, default is 50. |
Fits the matrix-variate skew regression model
where each response is a matrix that indexes observations and response variables. corresponds to a design matrix, and corresponds to a coefficient matrix. corresponds to a error matrix, following a matrix-variate variance-gamma distribution.
The model estimates MVVG parameters using the alternating expectation conditional maximization (AECM) algorithm, using the density
where , ,
, , and is the modified Bessel function of the second kind.
The structure of theta_g and parameter estimates returned by the function must be in the form of a list with the following named elements:
Theta: coefficient matrix
a: skewness vector
rho: Compound symmetry parameter for row correlation matrix
Psi: column covariance matrix
gamma: Univariate mixing parameter
MVVGmod returns a list with the following elements:
Iteration: Number of iterations taken to convergence. Inf if convergence not reached.
Starting Value: List of initial parameter values.
Final Value: List of final parameter estimates.
Stopping Criteria: Vector of at each iteration.
AIC: Model AIC
BIC: Model BIC
Samuel Soon
Dipankar Bandyopadhyay
Qingyang Liu
MVVGmod(Y,X,theta_mvvg) set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_gaad_theta_mvvg <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), gamma = 4) MVVGmod(gaad_res[1:10], gaad_cov[1:10], initial_gaad_theta_mvvg)MVVGmod(Y,X,theta_mvvg) set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_gaad_theta_mvvg <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), gamma = 4) MVVGmod(gaad_res[1:10], gaad_cov[1:10], initial_gaad_theta_mvvg)
Predicts response values given a list of covariate matrices and a model output from either MVVGmod or MVNIGmod.
predict(mod, X)predict(mod, X)
mod |
object outputted by either MVVGmod or MVNIGmod |
X |
Inputted covariate matrix |
Returns a list of predicted response matrices
Samuel Soon
Dipankar Bandyopadhyay
Qingyang Liu
set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_mvnig_theta <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), tgamma = 4) mvnig_mod <- MVNIGmod(gaad_res[1:10], gaad_cov[1:10], initial_mvnig_theta) predict(mvnig_mod, gaad_cov[1:10])set.seed(1234) # num response variables p <- ncol(gaad_res[[1]]) # num covariates q <- ncol(gaad_cov[[1]]) # generate initial value to input, then run AECM with MVVG distribution initial_mvnig_theta <- list(Theta = matrix(stats::rnorm(p*q), nrow = q, ncol = p), A = rep(1,p), rho = 0.3, Psi = diag(p), tgamma = 4) mvnig_mod <- MVNIGmod(gaad_res[1:10], gaad_cov[1:10], initial_mvnig_theta) predict(mvnig_mod, gaad_cov[1:10])
Part of toy dataset for examples.
theta_mvnigtheta_mvnig
List of parameters for input to MVNIGmod function
theta_mvvgtheta_mvvg
Part of toy dataset for examples.
theta_mvvgtheta_mvvg
List of parameters for input to MVVGmod function
theta_mvvgtheta_mvvg
Part of toy dataset for examples.
XX
List of covariate matrices for individual subjects
XX
Part of toy dataset for examples.
YY
List of response matrices for individual subjects
YY