Classify observations according to the maximum a posterior probabilites.
classify(x, theta)
x | Either a |
---|---|
theta | A list of parameters for the full model as described in
|
A integer vector of class numbers with length equal to the number of
rows in x
.
# Classify using probabilites (usually returned from get.prob) probs <- matrix(runif(75), 25, 3) classify(probs)#> [1] 3 1 3 3 1 3 3 3 1 1 1 3 1 2 2 3 1 3 3 2 2 1 2 3 3# Classify using a matrix of observations and theta theta <- rtheta(d = 4, m = 3) u <- SimulateGMCMData(n = 20, theta = theta)$u classify(x = u, theta = theta)#> [1] 3 2 2 3 2 2 2 1 2 3 3 2 2 3 2 3 3 1 2 2