Skip to contents

This function updates the class size vector.

Usage

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).

Value

An updated class size vector.

Examples

update_m(C = 3, z = c(1,1,1,2,2,3), FALSE)
#>      [,1]
#> [1,]    3
#> [2,]    2
#> [3,]    1