Learn R Programming

tclust (version 1.0-2)

bayesfact: Bayes Factor Analysis for tclust Objects

Description

Analyzes a tclust-object by calculating Bayes factors and comparing the quality of the actual cluster assignments and the second best possible assignment for each observation. Bayes factors, measuring the strength of the "trimming" decision may be defined (!? what does this sentence mean?). Cluster assignments of observations with large Bayes factors are considered as "doubtful" decisions. Silhouette plots give a graphical overview of the Bayes factors distribution (see plot.bayesfact). More details can be found in Garc�a-Escudero, L.A.; Gordaliza, A.; Matr�n, C. and Mayo-Iscar, A. (2009).

Usage

bayesfact(x, threshold = 1/10)

Arguments

x
A tclust object.
threshold
A cluster assignment or a trimming decision for an observation with a Bayes factor larger than log(threshold) is considered as a "doubtful" decision.

Value

  • The function returns an S3 object of type baysefact containing the following components:
  • xA tclust object.
  • ylimminA minimum y-limit calculated for plotting purposes.
  • indThe actual cluster assignment.
  • ind2The second most likely cluster assignment for each observation.
  • discThe (weighted) likelihood of the actual cluster assignment of each observation.
  • disc2The (weighted) likelihood of the second best cluster assignment of each observation.
  • assignfactThe factor log (disc/disc2).
  • thresholdThe threshold used for deciding whether assignfact indicates a "doubtful" assignment.
  • mean.bayesfactA vector of length k + 1 containing the mean Bayes factors for each cluster (including the outliers).

encoding

latin1

Details

This function compares the actual (best) assignment of each observation to its second best possible assignment. This comparison is based on the bayes factors of each observation, which are calculated here. If the Bayes factor of an observation is larger than a given level (log (threshold)), the observation is considered as "doubtfully" assigned to a cluster. More detailed information is shown when plotting the returned baysefact object.

References

Garc�a-Escudero, L.A.; Gordaliza, A.; Matr�n, C. and Mayo-Iscar, A. (2009), "Exploring the number of groups in robust model-based clustering". Preprint available at www.eio.uva.es/infor/personas/langel.html.

See Also

plot.bayesfact

Examples

Run this code
sig <- diag (2)
cen <- rep (1,2)
x <- rbind (
	rmvnorm (360, cen * 0,   sig),
	rmvnorm (540, cen * 5,   sig * 6 - 2),
	rmvnorm (100, cen * 2.5, sig * 50)
)
clus.1 <- tclust (x, k=2, alpha=0.1, restr.fact = 12)
clus.2 <- tclust (x, k=3, alpha=0.1, restr.fact = 1)  # "Improper" choice of parameters

bay.1 <- bayesfact(clus.1)
plot(bay.1)

bay.2 <- bayesfact(clus.2)
plot(bay.2)

Run the code above in your browser using DataLab