Learn R Programming

LogConcDEAD (version 1.5-5)

interactive2D: A GUI for classification in two dimensions using smoothed log-concave

Description

Uses tkrplot to create a GUI for two-class classification in two dimensions using the smoothed log-concave maximum likelihood estimates

Usage

interactive2D(data, cl)

Arguments

data
Data in $R^2$, in the form of an $n \times 2$ numeric matrix
cl
factor of true classifications of the data set

Value

  • A GUI with a slider

Details

This function uses tkrplot to create a GUI for two-class classification in two dimensions using the smoothed log-concave maximum likelihood estimates. The construction of the classifier is standard, and can be found in Chen and Samworth (2011). The slider controls the risk ratio of two classes (equals one by default), which provides a way of demonstrating how the decision boundaries change as the ratio varies. Observations from different classes are plotted in red and green respectively.

References

Chen, Y. and Samworth, R. J. (2012), Smoothed log-concave maximum likelihood estimation with applications Submitted. http://arxiv.org/abs/1102.1191v4

Cule, M. L., Samworth, R. J., and Stewart, M. I. (2010) Maximum likelihood estimation of a log-concave density, Journal of the Royal Statistical Society, Series B, 72(5) p.545-607.

See Also

dslcd,mlelcd

Examples

Run this code
##Simple bivariate normal data
  set.seed( 1 )
  n = 15
  d = 2
  props=c( 0.6, 0.4 )
  x <- matrix( rnorm( n*d ), ncol = d )
  shiftvec <- ifelse( runif( n ) > props[ 1 ], 0, 1)
  x[,1] <- x[,1] + shiftvec
  interactive2D( x, shiftvec )

Run the code above in your browser using DataLab