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 C. Set to NA if P_r = 0. For identifiability, the vector must be non-ascending.
b: The matrix of class means as columns of dimension P_r x C. Set to NA if P_r = 0.
Omega: The matrix of class covariance matrices as columns of dimension P_r*P_r x C. Set to NA if P_r = 0.
Returns
A list of updated values for s, b, and Omega.
Details
The updating scheme bases on the following rules:
We remove class c, if sc\<ϵmin, i.e. if the class weight sc drops below some threshold ϵmin. This case indicates that class c has a negligible impact on the mixing distribution.
We split class c into two classes c1 and c2, if scϵmax. This case indicates that class c 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 means bc1 and bc2 of the new classes c1 and c2 are shifted in opposite directions from the class mean bc of the old class c in the direction of the highest variance.
We join two classes c1 and c2 to one class c, if ∣∣bc1−bc2∣∣\<ϵdistmin, i.e. if the euclidean distance between the class means bc1 and bc2 drops below some threshold ϵdistmin. This case indicates location redundancy which should be repealed. The parameters of c are assigned by adding the values of s from c1 and c2 and averaging the values for b and Ω. The rules are executed in the above order, but only one rule per iteration and only if Cmax is not exceeded.
Examples
### parameter settingss <- 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 2RprobitB:::update_classes_wb(Cmax =10, epsmin =0.3, epsmax =0.9, distmin =1, s = s, b = b, Omega = Omega)### Split class 1RprobitB:::update_classes_wb(Cmax =10, epsmin =0.1, epsmax =0.7, distmin =1, s = s, b = b, Omega = Omega)### Join classesRprobitB:::update_classes_wb(Cmax =10, epsmin =0.1, epsmax =0.9, distmin =3, s = s, b = b, Omega = Omega)