post_conf_mat {IMIFA} | R Documentation |
Posterior Confusion Matrix
Description
For a (N * G
) matrix of posterior cluster membership probabilities, this function creates a (G * G
) posterior confusion matrix, whose hk-th entry gives the average probability that observations with maximum posterior allocation h will be assigned to cluster k.
Usage
post_conf_mat(z, scale = TRUE)
Arguments
z |
A ( Otherwise, a list of such matrices can be supplied, where each matrix in the list has the same dimensions. |
scale |
A logical indicator whether the PCM should be rescaled by its row sums. When |
Value
A (G * G
) posterior confusion matrix, whose hk-th entry gives the average probability that observations with maximum posterior allocation h will be assigned to cluster k. When scale=TRUE
, the benchmark matrix for comparison is the identity matrix of order G
, corresponding to a situation with no uncertainty in the clustering.
Author(s)
Keefe Murphy - <keefe.murphy@mu.ie>
References
Ranciati, S., Vinciotti, V. and Wit, E., (2017) Identifying overlapping terrorist cells from the Noordin Top actor-event network, Annals of Applied Statistics, 14(3): 1516-1534.
See Also
get_IMIFA_results
Examples
# data(olive)
# sim <- mcmc_IMIFA(olive, n.iters=1000)
# res <- get_IMIFA_results(sim)
# (PCM <- post_conf_mat(res$Clust$post.prob))
# par(mar=c(5.1, 4.1, 4.1, 3.1))
# PCM <- replace(PCM, PCM == 0, NA)
# plot_cols(mat2cols(PCM, col=heat.colors(30, rev=TRUE), na.col=par()$bg)); box(lwd=2)
# heat_legend(PCM, cols=heat.colors(30, rev=TRUE))
# par(mar=c(5.1, 4.1, 4.1, 2.1))