powered by
Converts unique cluster assignment stored in a length \(N\) label vector into a \(N \times K\) Boolean matrix of mixture weights.
states2weight_matrix(states, num.states.total = NULL)
a vector of length \(N\) with the state labels
total number of states. If NULL, then the maximum of states is chosen
NULL
states
weight_matrix2states
# NOT RUN { ss <- sample.int(5, 10, replace = TRUE) WW <- states2weight_matrix(ss) image2(WW, col = "RdBu", xlab = "States", ylab = "Samples", axes = FALSE) # }
Run the code above in your browser using DataLab