update_m function

Update class sizes

Update class sizes

This function updates the class size vector.

update_m(C, z, nozero)

Arguments

  • C: The number (greater or equal 1) of latent classes of decision makers. Set to NA if P_r = 0. Otherwise, C = 1 per default.
  • z: The vector of the allocation variables of length N. Set to NA if P_r = 0.
  • nozero: If TRUE, each element in the output vector m is at least one (for numerical stability).

Returns

An updated class size vector.

Examples

update_m(C = 3, z = c(1,1,1,2,2,3), FALSE)