Skip to contents

Fix Label Switching in MCMC Results from a Binary Outcome Misclassification Model

Usage

label_switch(chain_matrix, dim_x, dim_z, n_cat)

Arguments

chain_matrix

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] or gamma[k,j,p]).

dim_x

An integer specifying the number of columns of the design matrix of the true outcome mechanism, X.

dim_z

An integer specifying the number of columns of the design matrix of the observation mechanism, Z.

n_cat

An integer specifying the number of categorical values that the true outcome, Y, and the observed outcome, Y* can take.

Value

label_switch 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\) terms are "swapped" with the opposite j index.