rp_gaussian {spareg} | R Documentation |
Gaussian random projection matrix
Description
Creates an object class 'randomprojection'
using arguments passed by
user which in turn can be employed to generate a random matrix with normally
distributed entries (mean 0 and standard deviation 1 by default).
Usage
rp_gaussian(..., 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
Arguments related to the random projection procedure can
be passed to the rp_gaussian()
function through ...
, and
will be saved as attributes of the 'randomprojection'
object.
The following attributes are relevant for spar and spar.cv:
-
mslow
: integer giving the minimum dimension to which the predictors should be projected; defaults to\log(p)
. -
msup
: integer giving the maximum dimension to which the predictors should be projected; defaults ton/2
.
Value
object of class 'randomprojection'
which is a list with
elements name,
generate_fun
, update_fun
, control
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_gaussian(control = list(sd = 1/sqrt(ncol(example_data$x)))))