xorData: Generation of an xor Like Classification Problem

Description Usage Arguments Value

View source: R/xorData.R

Description

Generation of an xor like classification problem.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  xorData(n, prior = rep(0.5, 2), lambda = rep(0.5, 2),
    mu11 = c(2, 2), mu12 = c(-2, -2), mu21 = c(-2, 2),
    mu22 = c(2, -2), sigma = diag(2))

  xorLabels(data, prior = rep(0.5, 2),
    lambda = rep(0.5, 2), mu11 = c(2, 2), mu12 = c(-2, -2),
    mu21 = c(-2, 2), mu22 = c(2, -2), sigma = diag(2))

  xorPosterior(data, prior = rep(0.5, 2),
    lambda = rep(0.5, 2), mu11 = c(2, 2), mu12 = c(-2, -2),
    mu21 = c(-2, 2), mu22 = c(2, -2), sigma = diag(2))

  xorBayesClass(data, prior = rep(0.5, 2),
    lambda = rep(0.5, 2), mu11 = c(2, 2), mu12 = c(-2, -2),
    mu21 = c(-2, 2), mu22 = c(2, -2), 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.

mu21

Class center of second class, a vector.

mu22

Class center of second class, a vector.

sigma

Covariance matrix for class 1 and 2.

data

A data.frame.

Value

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

x

(A matrix.) The explanatory variables.

y

(A factor.) The class labels.

xorLabels returns a factor of class labels.

xorPosterior returns a matrix of posterior probabilities.

xorBayesClass returns a factor of Bayes predictions.


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