rp_gaussian | R Documentation |
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).
rp_gaussian(..., control = list())
... |
includes arguments which can be passed as attributes to the random projection matrix |
control |
list of arguments to be used in functions
|
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 to n/2
.
object of class 'randomprojection'
which is a list with
elements name,
generate_fun
, update_fun
, control
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)))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.