update_b | R Documentation |
Update class means
update_b(beta, Omega, z, m, Sigma_b_0_inv, mu_b_0)
beta |
[ |
Omega |
[ |
z |
[ |
m |
[ |
Sigma_b_0_inv |
[ |
mu_b_0 |
[ |
A matrix of updated means for each class in columns.
N <- 100
b <- cbind(c(0, 0), c(1, 1))
Omega <- matrix(c(1, 0.3, 0.3, 0.5, 1, -0.3, -0.3, 0.8), ncol = 2)
z <- c(rep(1, N / 2), rep(2, N / 2))
m <- as.numeric(table(z))
beta <- sapply(
z, function(z) oeli::rmvnorm(n = 1, b[, z], matrix(Omega[, z], 2, 2))
)
update_b(
beta = beta, Omega = Omega, z = z, m = m,
Sigma_b_0_inv = diag(2), mu_b_0 = c(0, 0)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.