R/sample_mu.R

sample_mu <-
function (z, X, covlist) {
  nsp <- ncol(z)
  mu <- matrix(NA, nrow(z), nsp)
  blis <- NULL
  for (i in 1:nsp) {
    x <- matrix(X[, covlist[[i]]], ncol = length(covlist[[i]]))
    b <- sample_B(matrix(z[, i], ncol = 1), x)
    mu[, i] <- x %*% b
    blis[[i]] <- b
  }
  list(mu, blis)
}

Try the BayesComm package in your browser

Any scripts or data that you put into this service are public.

BayesComm documentation built on May 2, 2019, 1:43 p.m.