Compute Probability of Each True Outcome, for Every Subject
pi_compute(beta, X, n, n_cat)
pi_compute
returns a matrix of probabilities,
\(P(Y_i = j | X_i) = \frac{\exp(X_i \beta)}{1 + \exp(X_i \beta)}\)
for each of the \(i = 1, \dots,\)
n
subjects. Rows of the matrix
correspond to each subject. Columns of the matrix correspond to the true outcome
categories \(j = 1, \dots,\)
n_cat
.
A numeric column matrix of regression parameters for the
Y
(true outcome) ~ X
(predictor matrix of interest).
A numeric design matrix.
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.