loglik_2stage {COMBO}R Documentation

Expected Complete Data Log-Likelihood Function for Estimation of the Two-Stage Misclassification Model

Description

Expected Complete Data Log-Likelihood Function for Estimation of the Two-Stage Misclassification Model

Usage

loglik_2stage(
  param_current,
  obs_Ystar_matrix,
  obs_Ytilde_matrix,
  X,
  Z,
  V,
  sample_size,
  n_cat
)

Arguments

param_current

A numeric vector of regression parameters, in the order \beta, \gamma, \delta. The \gamma vector is obtained from the matrix form. In matrix form, the gamma parameter matrix rows correspond to parameters for the Y* = 1 observed outcome, with the dimensions of Z. In matrix form, the gamma parameter matrix columns correspond to the true outcome categories j = 1, \dots, n_cat. The numeric vector \gamma is obtained by concatenating the gamma matrix, i.e. gamma_v <- c(gamma_matrix). The \delta vector is obtained from the array form. In array form, the first dimension (matrix rows) of delta corresponds to parameters for the \tilde{Y} = 1 second-stage observed outcome, with the dimensions of the V The second dimension (matrix columns) correspond to the first-stage observed outcome categories Y^* \in \{1, 2\}. The third dimension of delta_start corresponds to to the true outcome categories Y \in \{1, 2\}. The numeric vector \delta is obtained by concatenating the delta array, i.e. delta_vector <- c(delta_array).

obs_Ystar_matrix

A numeric matrix of indicator variables (0, 1) for the first-stage observed outcome Y*. Rows of the matrix correspond to each subject. Columns of the matrix correspond to each observed outcome category. Each row should contain exactly one 0 entry and exactly one 1 entry.

obs_Ytilde_matrix

A numeric matrix of indicator variables (0, 1) for the second-stage observed outcome \tilde{Y}. Rows of the matrix correspond to each subject. Columns of the matrix correspond to each observed outcome category. Each row should contain exactly one 0 entry and exactly one 1 entry.

X

A numeric design matrix for the true outcome mechanism.

Z

A numeric design matrix for the first-stage observation mechanism.

V

A numeric design matrix for the second-stage observation mechanism.

sample_size

An integer value specifying the number of observations in the sample. This value should be equal to the number of rows of the design matrices, X, Z, and V.

n_cat

The number of categorical values that the true outcome, Y, and the observed outcomes, Y* and \tilde{Y}, can take.

Value

loglik_2stage returns the negative value of the expected log-likelihood function, Q = \sum_{i = 1}^N \Bigl[ \sum_{j = 1}^2 w_{ij} \text{log} \{ \pi_{ij} \} + \sum_{j = 1}^2 \sum_{k = 1}^2 w_{ij} y^*_{ik} \text{log} \{ \pi^*_{ikj} \} + \sum_{j = 1}^2 \sum_{k = 1}^2 \sum_{\ell = 1}^2 w_{ij} y^*_{ik} \tilde{y}_{i \ell} \text{log} \{ \tilde{\pi}_{i \ell kj} \}\Bigr], at the provided inputs.


[Package COMBO version 1.1.0 Index]