Last data update: 2014.03.03

R: Gaussian Data Generation
simuldataR Documentation

Gaussian Data Generation

Description

This function generates two datasets according to the model [AkBkQkDk] of the HDDA gaussian mixture model paramatrisation (see ref.).

Usage

simuldata(nlearn, ntest, p, K = 3, prop = NULL, d = NULL, a = NULL, b = NULL)

Arguments

nlearn

The size of the learning dataset to be generated.

ntest

The size of the testing dataset to be generated.

p

The number of variables.

K

The number of classes.

prop

The proportion of each class.

d

The dimension of the intrinsic subspace of each class.

a

The value of the main parameter of each class.

b

The noise of each class.

Value

X

The learning dataset.

clx

The class vector of the learning dataset.

Y

The test dataset.

cly

The class vector of the test dataset.

prms

The principal parameters used to generate the datasets.

Author(s)

Laurent Berge, Charles Bouveyron and Stephane Girard

References

Bouveyron, C. Girard, S. and Schmid, C. (2007) “High Dimensional Discriminant Analysis”, Communications in Statistics : Theory and Methods, vol. 36(14), pp. 2607–2623

See Also

hddc, hdda.

Examples

data <- simuldata(500, 1000, 50, K=5, prop=c(0.2,0.25,0.25,0.15,0.15))
X <- data$X
clx <- data$clx
f <- hdda(X, clx)
Y <- data$Y
cly <- data$cly
e <- predict(f, Y, cly)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HDclassif)
Loading required package: MASS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HDclassif/simuldata.Rd_%03d_medium.png", width=480, height=480)
> ### Name: simuldata
> ### Title: Gaussian Data Generation
> ### Aliases: simuldata
> ### Keywords: generation gaussian
> 
> ### ** Examples
> 
> data <- simuldata(500, 1000, 50, K=5, prop=c(0.2,0.25,0.25,0.15,0.15))
> X <- data$X
> clx <- data$clx
> f <- hdda(X, clx)
> Y <- data$Y
> cly <- data$cly
> e <- predict(f, Y, cly)
Correct classification rate: 0.964.
               Initial class
Predicted class   1   2   3   4   5
              1 204   0   0   0   0
              2   0 258   0   0   0
              3   0   0 229   6   1
              4   0   0   3 126  12
              5   0   0   2  12 147
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>