twonormQuadraticData: Generate a Binary Classification Problem with Two Gaussian...

Description Usage Arguments Value

View source: R/twonormQuadraticData.R

Description

Generate a binary classification problem with two Gaussian distributions with different means and covariance matrices.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  twonormQuadraticData(n, prior = rep(0.5, 2),
    mu1 = c(1, 0), mu2 = c(0, -1), sigma1 = diag(2),
    sigma2 = matrix(c(1, 0.5, 0.5, 1), 2))

  twonormQuadraticLabels(data, prior = rep(0.5, 2),
    mu1 = c(1, 0), mu2 = c(0, -1), sigma1 = diag(2),
    sigma2 = matrix(c(1, 0.5, 0.5, 1), 2))

  twonormQuadraticPosterior(data, prior = rep(0.5, 2),
    mu1 = c(1, 0), mu2 = c(0, -1), sigma1 = diag(2),
    sigma2 = matrix(c(1, 0.5, 0.5, 1), 2))

  twonormQuadraticBayesClass(data, prior = rep(0.5, 2),
    mu1 = c(1, 0), mu2 = c(0, -1), sigma1 = diag(2),
    sigma2 = matrix(c(1, 0.5, 0.5, 1), 2))

Arguments

n

Number of observations.

prior

Vector of class prior probabilities.

mu1

Class center of first class, a vector.

mu2

Class center of second class, a vector.

sigma1

Covariance matrix for class 1.

sigma2

Covariance matrix for class 2.

data

A data.frame.

Value

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

x

(A matrix.) The explanatory variables.

y

(A factor.) The class labels.

twonormQuadraticLabels returns a factor of class labels.

twonormQuadraticPosterior returns a matrix of posterior probabilities.

twonormQuadraticBayesClass returns a factor of Bayes predictions.


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