plot.gcjc: Plot Method for Class 'gcjc'

Description Usage Arguments Details Examples

View source: R/plot.gcjc.R

Description

Plot the fitted data set and decision boundary.

Usage

1
2
## S3 method for class 'gcjc'
plot(x, fitdb = TRUE, initdb = FALSE, xlim = NULL, ylim = NULL, bg, pch, ...)

Arguments

x

object of class gcjc

fitdb

logical. If TRUE, the fitted decision bound is plotted. Default to TRUE

initdb

logical. If TRUE, the decision bound specified by the initial parameters is plotted. Default to FALSE

xlim

the x limits of the plot

ylim

the y limits of the plot

bg

the background color to be used for points. Default is c("white","gray")[response] where response represents the response vector of the model

pch

the symbols to be used as points. Default is c(21,24)[x$category]

...

further arguments.

Details

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

matsukik/grt documentation built on May 21, 2019, 12:57 p.m.