update_z | R Documentation |
This function updates the class allocation vector (independently for all observations) by drawing from its conditional distribution.
update_z(s, beta, b, Omega)
s |
The vector of class weights of length |
beta |
The matrix of the decision-maker specific coefficient vectors of dimension
|
b |
The matrix of class means as columns of dimension |
Omega |
The matrix of class covariance matrices as columns of dimension
|
Let z = (z_1,…,z_N) denote the class allocation vector of the observations (mixed coefficients) β = (β_1,…,β_N). Independently for each n, the conditional probability \Pr(z_n = c \mid s,β_n,b,Ω) of having β_n allocated to class c for c=1,…,C depends on the class allocation vector s, the class means b=(b_c)_c and the class covariance matrices Omega=(Omega_c)_c and is proportional to
s_c φ(β_n \mid b_c,Omega_c).
An updated class allocation vector.
### class weights for C = 2 classes s <- rdirichlet(c(1,1)) ### coefficient vector for N = 1 decider and P_r = 2 random coefficients beta <- matrix(c(1,1), ncol = 1) ### class means and covariances b <- cbind(c(0,0),c(1,1)) Omega <- cbind(c(1,0,0,1),c(1,0,0,1)) ### updated class allocation vector update_z(s = s, beta = beta, b = b, Omega = Omega)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.