rp_cw | R Documentation |
Creates an object class 'randomprojection'
using arguments passed by
user which in turn can be employed to generate a sparse embedding matrix as
in \insertCiteClarkson2013LowRankApproxspareg.
rp_cw(..., control = list())
... |
includes arguments which can be passed as attributes to the random projection matrix |
control |
list of arguments to be used in functions
|
The entries of the matrix are generated based on \insertCiteClarkson2013LowRankApproxspareg.
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
\insertCiteparzer2024glmsspareg.
object of class 'randomprojection'
which is a list with
elements name,
generate_fun
, update_fun
, control
Clarkson2013LowRankApproxspareg
\insertRefparzer2024glmsspareg.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.