rp_cw {spareg} | R Documentation |
Sparse embedding matrix
Description
Creates an object class 'randomprojection'
using arguments passed by
user which in turn can be employed to generate a sparse embedding matrix as
in (Clarkson and Woodruff 2013).
Usage
rp_cw(..., control = list())
Arguments
... |
includes arguments which can be passed as attributes to the random projection matrix |
control |
list of arguments to be used in functions
|
Details
The entries of the matrix are generated based on (Clarkson and Woodruff 2013).
This matrix is constructed as \Phi=BD\in \mathbb{R}^{m\times p}
, where
B
is a (p\times p)
binary matrix, where for each column j
an index is uniformly sampled from \{1,\ldots,m\}
and the corresponding
entry is set to one, and D
is a (p\times p)
diagonal matrix,
with entries d_j \sim \text{Unif}(\{-1, 1\})
.
If specified as rp_cw(data = TRUE)
, the random elements on the diagonal
are replaced by the ridge coefficients with a small penalty, as introduced in
(Parzer et al. 2024).
Value
object of class 'randomprojection'
which is a list with
elements name,
generate_fun
, update_fun
, control
References
Clarkson KL, Woodruff DP (2013). “Low Rank Approximation and Regression in Input Sparsity Time.” In Proceedings of the Forty-Fifth Annual ACM Symposium on Theory of Computing, STOC '13, 81–90. ISBN 9781450320290, doi:10.1145/2488608.2488620.
Parzer R, Filzmoser P, Vana-Gür L (2024). “Data-Driven Random Projection and Screening for High-Dimensional Generalized Linear Models.” Technical Report 2410.00971, arXiv.org E-Print Archive. doi:10.48550/arXiv.2410.00971..
Examples
example_data <- simulate_spareg_data(n = 200, p = 2000, ntest = 100)
spar_res <- spar(example_data$x, example_data$y, xval = example_data$xtest,
yval = example_data$ytest, nummods=c(5, 10, 15, 20, 25, 30),
rp = rp_cw(data = TRUE))