Learn R Programming

RPEnsemble (version 0.2)

RPGenerate: Generate a random p by d matrix

Description

Generates a random projection according to Haar measure or a uniform distribution on axis-aligned projections.

Usage

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

Arguments

p
The original data dimension
d
The lower dimension
method
Projection distribution: either "Haar" for Haar distributed projections, "axis" for uniformly distributed axis-aligned projections, or "other" for user defined method

Value

p by d random matrix

References

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

Examples

Run this code
R1 <- RPGenerate(20, 2, "Haar")
t(R1)%*%R1
R2 <- RPGenerate(20, 2, "axis")
colSums(R2)
rowSums(R2)

Run the code above in your browser using DataLab