xor3Data: Generation of a Checkerboard Like Classification Problem with...

Description Usage Arguments Value

View source: R/xor3Data.R

Description

Generation of a checkerboard like classification problem with 3 classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  xor3Data(n, prior = rep(1/3, 3), lambda = rep(1/3, 3),
    mu11 = c(-4, 4), mu12 = c(0, -4), mu13 = c(4, 0),
    mu21 = c(-4, 0), mu22 = c(0, 4), mu23 = c(4, -4),
    mu31 = c(-4, -4), mu32 = c(0, 0), mu33 = c(4, 4),
    sigma = diag(2))

  xor3Labels(data, prior = rep(1/3, 3),
    lambda = rep(1/3, 3), mu11 = c(-4, 4), mu12 = c(0, -4),
    mu13 = c(4, 0), mu21 = c(-4, 0), mu22 = c(0, 4),
    mu23 = c(4, -4), mu31 = c(-4, -4), mu32 = c(0, 0),
    mu33 = c(4, 4), sigma = diag(2))

  xor3Posterior(data, prior = rep(1/3, 3),
    lambda = rep(1/3, 3), mu11 = c(-4, 4), mu12 = c(0, -4),
    mu13 = c(4, 0), mu21 = c(-4, 0), mu22 = c(0, 4),
    mu23 = c(4, -4), mu31 = c(-4, -4), mu32 = c(0, 0),
    mu33 = c(4, 4), sigma = diag(2))

  xor3BayesClass(data, prior = rep(1/3, 3),
    lambda = rep(1/3, 3), mu11 = c(-4, 4), mu12 = c(0, -4),
    mu13 = c(4, 0), mu21 = c(-4, 0), mu22 = c(0, 4),
    mu23 = c(4, -4), mu31 = c(-4, -4), mu32 = c(0, 0),
    mu33 = c(4, 4), sigma = diag(2))

Arguments

n

Number of observations.

prior

Vector of class prior probabilities.

lambda

The conditional probabilities for the mixture components given the class. Either a vector (if the same number m of mixture components is desired for each class and the conditional probabilities for each class should be equal) or a list as long as the number of classes containing one vector of probabilities for every class. The length of the k-th element is the desired number of mixture components for the k-th class.

mu11

Class center of first class, a vector.

mu12

Class center of first class, a vector.

mu13

Class center of first class, a vector.

mu21

Class center of second class, a vector.

mu22

Class center of second class, a vector.

mu23

Class center of second class, a vector.

mu31

Class center of second class, a vector.

mu32

Class center of second class, a vector.

mu33

Class center of second class, a vector.

sigma

Covariance matrix for classes 1, 2, and 3.

data

A data.frame.

Value

xor3Data returns an object of class "locClass", a list with components:

x

(A matrix.) The explanatory variables.

y

(A factor.) The class labels.

xor3Labels returns a factor of class labels.

xor3Posterior returns a matrix of posterior probabilities.

xor3BayesClass returns a factor of Bayes predictions.


locClassData documentation built on May 2, 2019, 5:26 p.m.