Objective function of the form: \( Q_\beta = \sum_{i = 1}^N \Bigl[ \sum_{j = 0}^1 w_{ij} \text{log} \{ \pi_{ij} \}\Bigr]\). Used to obtain estimates of \(\beta\) parameters.
q_beta_f(beta, X, w_mat, sample_size, n_cat)q_beta_f returns the negative value of the expected log-likelihood function,
\( Q_\beta = \sum_{i = 1}^N \Bigl[ \sum_{j = 1}^2 w_{ij} \text{log} \{ \pi_{ij} \}\Bigr]\),
at the provided inputs.
A numeric vector of regression parameters for the
Y (true outcome) ~ X (predictor matrix of interest).
A numeric design matrix.
Matrix of E-step weights obtained from w_j.
An integer value specifying the number of observations in the sample.
This value should be equal to the number of rows of the design matrix, X.
The number of categorical values that the true outcome, Y,
can take.