post_conf_mat function

Posterior Confusion Matrix

Posterior Confusion Matrix

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.

post_conf_mat(z, scale = TRUE)

Arguments

  • z: A (N * G) matrix of posterior cluster membership probabilities whose (ig)-th entry gives the posterior probability that observation i belongs to cluster g. Entries must be valid probabilities in the interval [0,1]; missing values are not allowed.

    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 TRUE (the default), the benchmark matrix for comparison is the identity matrix of order G, corresponding to a situation with no uncertainty in the clustering. When FALSE, the row sums give the number of observations in each cluster.

Returns

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.

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))

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

Author(s)

Keefe Murphy - <keefe.murphy@mu.ie >

  • Maintainer: Keefe Murphy
  • License: GPL (>= 3)
  • Last published: 2023-12-12