update_classes_dp | R Documentation |
This function updates the latent classes based on a Dirichlet process.
update_classes_dp(
Cmax,
beta,
z,
b,
Omega,
delta,
xi,
D,
nu,
Theta,
s_desc = TRUE
)
Cmax |
The maximum number of classes. |
beta |
The matrix of the decision-maker specific coefficient vectors of dimension
|
z |
The vector of the allocation variables of length |
b |
The matrix of class means as columns of dimension |
Omega |
The matrix of class covariance matrices as columns of dimension
|
delta |
A numeric for the concentration parameter vector |
xi |
The mean vector of length |
D |
The covariance matrix of dimension |
nu |
The degrees of freedom (a natural number greater than |
Theta |
The scale matrix of dimension |
s_desc |
If |
To be added.
A list of updated values for z
, b
, Omega
, s
,
and C
.
set.seed(1)
z <- c(rep(1,20),rep(2,30))
b <- matrix(c(1,1,1,-1), ncol=2)
Omega <- matrix(c(1,0.3,0.3,0.5,1,-0.3,-0.3,0.8), ncol=2)
beta <- sapply(z, function(z) rmvnorm(b[,z], matrix(Omega[,z],2,2)))
delta <- 1
xi <- numeric(2)
D <- diag(2)
nu <- 4
Theta <- diag(2)
RprobitB:::update_classes_dp(
Cmax = 10, beta = beta, z = z, b = b, Omega = Omega,
delta = delta, xi = xi, D = D, nu = nu, Theta = Theta
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.