state_to_subclass = [1 2 1 2];The transitioning of states can also be constrained using the nstate-by-nstate matrix A_mask which is used as a mask for the state transition matrix. For example, setting
A_mask = [1 1 1 1; 0 1 1 1; 0 0 1 1; 0 0 0 1];will result in a forward-only state transition matrix. The variables Pi_mask, beta_end are vectors of length nstate that define the states in which MR-HMM can start and end, respectively. Leaving any of these A_mask, Pi_mask, beta_end empty or not supplying them assumes that they are full (all states and state transitions allowed).