Fix Label Switching in MCMC Results from a Binary Outcome Misclassification Model
label_switch_2stage(chain_matrix, dim_x, dim_z, dim_v, n_cat)label_switch_2stage returns a named matrix of MCMC posterior samples for
all parameters after performing label switching according the following pattern:
all \(\beta\) terms are multiplied by -1, all \(\gamma\) and \(\delta\) terms are "swapped"
with the opposite j index.
A numeric matrix containing the posterior samples for all
parameters in a given MCMC chain. chain_matrix must be a named
object (i.e. each parameter must be named as beta[j, p], gamma[k,j,p],
or delta[l,k,j,p]).
An integer specifying the number of columns of the design matrix of the true outcome mechanism, X.
An integer specifying the number of columns of the design matrix of the first-stage observation mechanism, Z.
An integer specifying the number of columns of the design matrix of the second-stage observation mechanism, V.
An integer specifying the number of categorical values that the true outcome, \(Y\), the first-stage observed outcome, \(Y^*\), and the second-stage observed outcome \(\tilde{Y}\) can take.