Learn R Programming

RPEnsemble (version 0.2)

RPModel: Generate pairs from joint distribution

Description

Generates data from the models described in Cannings and Samworth (2015).

Usage

RPModel(Model.No, n, p, Pi = 1/2)

Arguments

Model.No
Model number
n
Sample size
p
Data dimension
Pi
Class one prior probability

Value

x
An n by p data matrix -- n observations of the p-dimensional features
y
A vector of length n containing the classes (either 1 or 2)

References

Cannings, T. I. and Samworth, R. J. (2015) Random projection ensemble classification. http://arxiv.org/abs/1504.04595

Examples

Run this code
Data <- RPModel(Model.No = 1, 100, 50, Pi = 1/2)
table(Data$y)
colMeans(Data$x[Data$y==1,])
colMeans(Data$x[Data$y==2,])

Run the code above in your browser using DataLab