update_classes_wb {RprobitB} | R Documentation |
Weight-based update of latent classes
Description
This function updates the latent classes based on their class weights.
Usage
update_classes_wb(Cmax, epsmin, epsmax, distmin, s, b, Omega)
Arguments
Cmax |
The maximum number of classes. |
epsmin |
The threshold weight (between 0 and 1) for removing a class. |
epsmax |
The threshold weight (between 0 and 1) for splitting a class. |
distmin |
The (non-negative) threshold difference in class means for joining two classes. |
s |
The vector of class weights of length |
b |
The matrix of class means as columns of dimension |
Omega |
The matrix of class covariance matrices as columns of dimension
|
Details
The updating scheme bases on the following rules:
We remove class
c
, ifs_c<\epsilon_{min}
, i.e. if the class weights_c
drops below some threshold\epsilon_{min}
. This case indicates that classc
has a negligible impact on the mixing distribution.We split class
c
into two classesc_1
andc_2
, ifs_c>\epsilon_{max}
. This case indicates that classc
has a high influence on the mixing distribution whose approximation can potentially be improved by increasing the resolution in directions of high variance. Therefore, the class meansb_{c_1}
andb_{c_2}
of the new classesc_1
andc_2
are shifted in opposite directions from the class meanb_c
of the old classc
in the direction of the highest variance.We join two classes
c_1
andc_2
to one classc
, if||b_{c_1} - b_{c_2}||<\epsilon_{distmin}
, i.e. if the euclidean distance between the class meansb_{c_1}
andb_{c_2}
drops below some threshold\epsilon_{distmin}
. This case indicates location redundancy which should be repealed. The parameters ofc
are assigned by adding the values ofs
fromc_1
andc_2
and averaging the values forb
and\Omega
. The rules are executed in the above order, but only one rule per iteration and only ifCmax
is not exceeded.
Value
A list of updated values for s
, b
, and Omega
.
Examples
### parameter settings
s <- c(0.8,0.2)
b <- matrix(c(1,1,1,-1), ncol=2)
Omega <- matrix(c(0.5,0.3,0.3,0.5,1,-0.1,-0.1,0.8), ncol=2)
### Remove class 2
RprobitB:::update_classes_wb(Cmax = 10, epsmin = 0.3, epsmax = 0.9, distmin = 1,
s = s, b = b, Omega = Omega)
### Split class 1
RprobitB:::update_classes_wb(Cmax = 10, epsmin = 0.1, epsmax = 0.7, distmin = 1,
s = s, b = b, Omega = Omega)
### Join classes
RprobitB:::update_classes_wb(Cmax = 10, epsmin = 0.1, epsmax = 0.9, distmin = 3,
s = s, b = b, Omega = Omega)