| coefficient_updates | R Documentation |
Low-level Gibbs sampler kernels for coefficient means and covariance matrices.
update_coefficient(mu_beta_0, Sigma_beta_0_inv, XSigX, XSigU)
update_b_c(bar_b_c, Omega_c, m_c, Sigma_b_0_inv, mu_b_0)
update_b(beta, Omega, z, m, Sigma_b_0_inv, mu_b_0)
update_Omega_c(S_c, m_c, n_Omega_0, V_Omega_0, correlated)
update_Omega(beta, b, z, m, n_Omega_0, V_Omega_0, correlated = NULL)
mu_beta_0 |
[ |
Sigma_beta_0_inv |
[ |
XSigX |
[ |
XSigU |
[ |
bar_b_c |
[ |
Omega_c |
[ |
m_c |
[ |
Sigma_b_0_inv |
[ |
mu_b_0 |
[ |
beta |
[ |
Omega |
[ |
z |
[ |
m |
[ |
S_c |
[ |
n_Omega_0 |
[ |
V_Omega_0 |
[ |
correlated |
[ |
b |
[ |
The functions return one sampler update:
update_b_c(): a P by 1 numeric matrix containing a class mean.
update_b(): a P by C matrix of class means.
update_Omega_c(): a P by P class covariance matrix.
update_Omega(): a P * P by C matrix of vectorized covariances.
update_coefficient(): a P by 1 numeric coefficient matrix.
### four deciders with one random coefficient in two classes
set.seed(1)
beta <- matrix(c(-1, -1.2, 1, 1.3), nrow = 1)
Omega <- matrix(c(0.2, 0.2), nrow = 1)
z <- c(1, 1, 2, 2)
m <- c(2, 2)
### a coefficient from its conditional posterior
update_coefficient(c(0, 0), diag(2), diag(2), c(0, 0))
### the class means, for one class and for all classes at once
update_b_c(
bar_b_c = c(0, 0), Omega_c = diag(2), m_c = 4,
Sigma_b_0_inv = diag(2), mu_b_0 = c(0, 0)
)
update_b(beta, Omega, z, m, Sigma_b_0_inv = diag(1), mu_b_0 = 0)
### the class covariances
update_Omega_c(
S_c = diag(2), m_c = 4, n_Omega_0 = 4, V_Omega_0 = diag(2),
correlated = c(TRUE, TRUE)
)
update_Omega(
beta, b = matrix(c(-1, 1), nrow = 1), z, m,
n_Omega_0 = 4, V_Omega_0 = diag(1)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.