Last data update: 2014.03.03

R: multivariate Bernoulli mixed-effects model fitting
mvbmeR Documentation

multivariate Bernoulli mixed-effects model fitting

Description

fit multivariate Bernoulli mixed-effects model using Laplacian approximation.

Usage

mvbme(x, y, z, maxOrder = 2,
       output = 0, printIter = 100)

Arguments

x

input design matrix.

y

output binary matrix with number of columns equal to the number of outcomes per observation.

z

random effect design matrix.

maxOrder

maximum order of interactions to be considered in outcomes.

output

with values 0 or 1, indicating whether the fitting process is muted or not.

printIter

Number of iterations to be printed if output is true.

Details

The mvbme utilize the class structure of the underlying C++ code and fitted the model with Laplacian approximation.

Value

An object of class mvbfit, for which some methods are available.

See Also

mvblps, unifit, stepfit, mvb.simu

Examples

# fit a simple MVB log-linear model
n <- 1000
p <- 5
kk <- 2
tt <- NULL
alter <- 1
for (i in 1:kk) {
  vec <- rep(0, p)
  vec[i] <- alter
  alter <- alter * (-1)
  tt <- cbind(tt, vec)
}
tt <- 1.5 * tt
tt <- cbind(tt, c(rep(0, p - 1), 1))

x <- matrix(rnorm(n * p, 0, 4), n, p)
res <- mvb.simu(tt, x, K = kk, rep(.5, 2))
fitMVB <- mvbfit(x, res$response, output = 1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MVB)
Loading required package: Rcpp
Loading required package: RcppArmadillo
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MVB/mvbme.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mvbme
> ### Title: multivariate Bernoulli mixed-effects model fitting
> ### Aliases: mvbme
> 
> ### ** Examples
> 
> # fit a simple MVB log-linear model
> n <- 1000
> p <- 5
> kk <- 2
> tt <- NULL
> alter <- 1
> for (i in 1:kk) {
+   vec <- rep(0, p)
+   vec[i] <- alter
+   alter <- alter * (-1)
+   tt <- cbind(tt, vec)
+ }
> tt <- 1.5 * tt
> tt <- cbind(tt, c(rep(0, p - 1), 1))
> 
> x <- matrix(rnorm(n * p, 0, 4), n, p)
> res <- mvb.simu(tt, x, K = kk, rep(.5, 2))
> fitMVB <- mvbfit(x, res$response, output = 1)
fit started
iteration 0 gpnorm = 2.52044
iteration 8 gpnorm = 1.91643e-07
*** Converged ***
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>