Learn R Programming

updog (version 1.2.0)

uni_em_const: EM algorithm to fit weighted ash objective with a uniform mixing component.

Description

Solves the following optimization problem $$\max_{\pi} \sum_k w_k \log(\alpha / (K+1) + (1 - \alpha)\sum_j \pi_j \ell_jk).$$ It does this using a weighted EM algorithm.

Usage

uni_em_const(weight_vec, lmat, pi_init, alpha, lambda, itermax, obj_tol)

Arguments

weight_vec

A vector of weights. Each element of weight_vec corresponds to a column of lmat.

lmat

A matrix of inner weights. The columns are the "individuals" and the rows are the "classes."

pi_init

The initial values of pivec. Each element of pi_init corresponds to a row of lmat.

alpha

The mixing weight for the uniform component. This should be small (say, less tahn 10^-3).

lambda

A vector of penalties on the pi's (corresponding to the rows of lmat). This can either be of length 1, in which case the same penalty is applied to each of the pi's. Or it can be the same length of pivec, in which case a different penalty is applied to each of the pi's. Larger penalties generally increase the value of the pi's, not shrink them.

itermax

The maximum number of EM iterations to take.

obj_tol

The objective stopping criterion.

Value

A vector of numerics. The update of pivec in flexdog_full.