Learn R Programming

RPEnsemble (version 0.5)

RPGenerate: Generates random matrices

Description

Generates B2 random p by d matrices according to Haar measure, Gaussian or axis-aligned projections

Usage

RPGenerate(p = 100, d = 10, method = "Haar", B2 = 10)

Arguments

p

The original data dimension

d

The lower dimension

method

Projection distribution, either "Haar" for Haar distributed projections, "Gaussian" for Gaussian distributed projections with i.i.d. N(0,1/p) entries, "axis" for uniformly distributed axis aligned projections, or "other" for user defined method

B2

the number of projections

Value

returns B2 p by d random matrices as a single p by d*B2 matrix

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 {
R1 <- RPGenerate(p = 20, d = 2, "Haar", B2 = 3)
t(R1)%*%R1
R2 <- RPGenerate(p = 20, d = 2, "Gaussian", B2 = 3)
t(R2)%*%R2
R3 <- RPGenerate(p = 20, d = 2, "axis", B2 = 3)
colSums(R3)
rowSums(R3)
# }

Run the code above in your browser using DataLab