Last chance! 50% off unlimited learning
Sale ends in
Plot the fitted data set and decision boundary.
# S3 method for gcjc
plot(x, fitdb = TRUE, initdb = FALSE, xlim = NULL, ylim = NULL, bg, pch, …)
object of class gcjc
logical. If TRUE
, the fitted decision bound is plotted. Default to TRUE
logical. If TRUE
, the decision bound specified by the initial parameters is plotted. Default to FALSE
the x limits of the plot
the y limits of the plot
the background color to be used for points. Default is c("white","gray")[response]
where response
represents the response vector of the model
the symbols to be used as points. Default is c(21,24)[x$category]
further arguments.
This function produces a scatter plot of data matrix in the x
and (optionally) decision boundary specified within (i.e., x$par
and/or x$initpar
).
# NOT RUN {
m <- list(c(100,200),c(100,100),c(200,100),c(200,200))
covs <- diag(30^2, ncol=2, nrow=2)
set.seed(1)
CJ <- grtrnorm(n=c(50,20,10,20), np=4, means=m, covs=covs)
CJ$category <- c(1,2,2,2)[CJ$category]
#create ramdom responses with 80% accuracy
CJ$response <- CJ$category
set.seed(1)
incorrect <- sample(1:100, size=20)
CJ$response[incorrect] <- abs(CJ$response[incorrect] - 3)
#now fit the model
m.cj <- gcjc(response ~ x1 + x2, data=CJ, config=2, category=CJ$category, zlimit=7)
plot(m.cj)
# }
Run the code above in your browser using DataLab