Solves the following optimization problem $$\max_{\pi} \sum_k w_k \log(\sum_j \pi_j \ell_jk).$$ It does this using a weighted EM algorithm.
uni_em(weight_vec, lmat, pi_init, lambda, itermax, obj_tol)
A vector of weights. Each element of weight_vec
corresponds
to a column of lmat
.
A matrix of inner weights. The columns are the "individuals" and the rows are the "classes."
The initial values of pivec
. Each element of pi_init
corresponds to a row of lmat
.
The penalty on the pi's. Should be greater than 0 and really really small.
The maximum number of EM iterations to take.
The objective stopping criterion.
A vector of numerics. The update of pivec
in
flexdog_full
.