10.9 Pattern Classification Accuracy

In addition to classification accuracy at individual attribute level, we may be also interested in pattern level accuracy.

Given a finite sample \(\mathbf{y}\) of size \(n\), we can estimate a pattern level accuracy (Iaconangelo, 2017) as in

\[ \hat{p}_{\mathbf{{\alpha}}_{c}}=\frac{1}{n}\sum_{i=1}^nP(\mathbf{{\alpha}}_{i}=\mathbf{{\alpha}}_{c}|\mathbf{y}_i)I(\mathbf{\hat{\alpha}}_{i}=\mathbf{{\alpha}}_{c}|\mathbf{y}_i) \] The following code finds the pattern level accuracy for attribute profile 000:

Code
library(GDINA)
Y <- ecpe$dat
Q <- ecpe$Q
lcdm <- GDINA(Y, Q, model = "GDINA",verbose = 0)
post <- exp(indlogPost(lcdm))
MAP <- personparm(lcdm,"MAP")[,1:3]
p000 <- mean(post[which(rowSums(MAP)==0),1])
p000
## [1] 0.8144