constructor_randomprojection {spareg}R Documentation

Constructor function for building 'randomprojection' objects

Description

Creates an object class 'randomprojection' using arguments passed by user.

Usage

constructor_randomprojection(
  name,
  generate_fun,
  update_fun = NULL,
  update_rpm_w_data = NULL,
  control = list()
)

Arguments

name

character

generate_fun

function for generating the random projection matrix. This function should have with arguments rp, which is a 'randomprojection' object, m, the target dimension and a vector of indexes included_vector, x matrix of predictors and y matrix of predictors. Vector included_vector shows the column index of the original variables in the x matrix to be projected using the random projection. This is needed due to the fact that screening is employed pre-projection.

update_fun

function for updating the 'randomprojection' object with information from the data. This function should have arguments rp, which is a 'randomprojection' object and x (the matrix of predictors) and y (the vector of responses).

update_rpm_w_data

function for updating the random projection matrix with data. This can be used for the case where a list of random projection matrices is provided by argument RPMs. In this case, the random structure is kept fixed, but the data-dependent part gets updated with the provided data. Defaults to NULL. If not provided, the values of the provided RPMs do not change.

control

list of controls for random projection. Can include minimum and maximum dimension for the projection defaults to list(mslow = NULL, msup = NULL)

Value

a function which in turn creates an object of class 'randomprojection'


[Package spareg version 1.1.0 Index]