Randomly reassign individual(s) if there are empty groups. This can happen if the total number of time series is low compared to the number of desired groups.
reassign_if_empty_groups(g, S_true, NN)numeric vector with the estimated group membership for all time series
Vector with group membership for all individuals
true number of groups
number of time series