Learn R Programming

RPEnsemble (version 0.5)

RPModel: Generate pairs (x,y) from joint distribution

Description

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

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. (2017) Random-projection ensemble classification, J. Roy. Statist. Soc., Ser. B. (with discussion), 79, 959--1035

Examples

Run this code
# NOT RUN {
Data <- RPModel(Model.No = 1, 100, 100, 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