shared_dgp_lib_args: Arguments that are shared by multiple 'DGP' library...

shared_dgp_lib_argsR Documentation

Arguments that are shared by multiple DGP library functions.

Description

Arguments that are shared by multiple DGP library functions.

Arguments

betas

Coefficient vector for observed design matrix. If a scalar is provided, the coefficient vector is constant. If NULL (default), entries in the coefficient vector are drawn iid from N(0, betas_sd^2). Can also be a function that generates the coefficient vector; see generate_coef().

betas_sd

(Optional) SD of normal distribution from which to draw betas. Only used if betas argument is NULL or is a function in which case betas_sd is optionally passed to the function as sd; see generate_coef().

betas_unobs

Coefficient vector for unobserved design matrix. If a scalar is provided, the coefficient vector is constant. If NULL (default), entries in the coefficient vector are drawn iid from N(0, betas_unobs_sd^2). Can also be a function that generates the coefficient vector; see generate_coef().

betas_unobs_sd

(Optional) SD of normal distribution from which to draw betas_unobs. Only used if betas_unobs argument is NULL or is a function in which case betas_unobs_sd is optionally passed to the function as sd; see generate_coef().

betas_corr

Coefficient vector for correlated features. If a scalar is provided, the coefficient vector is constant. If NULL (default), entries in the coefficient vector are drawn iid from N(0, betas_corr_sd^2). Can also be a function that generates the coefficient vector; see generate_coef().

betas_corr_sd

(Optional) SD of normal distribution from which to draw betas_corr. Only used if betas_corr argument is NULL or is a function in which case betas_corr_sd is optionally passed to the function as sd; see generate_coef().

betas_uncorr

Coefficient vector for uncorrelated features. If a scalar is provided, the coefficient vector is constant. If NULL (default), entries in the coefficient vector are drawn iid from N(0, betas_uncorr_sd^2). Can also be a function that generates the coefficient vector; see generate_coef().

betas_uncorr_sd

(Optional) SD of normal distribution from which to draw betas_uncorr. Only used if betas_uncorr argument is NULL or is a function in which case betas_uncorr_sd is optionally passed to the function as sd; see generate_coef().

data_split

Logical; if TRUE, splits data into training and test sets according to train_prop.

err

Function from which to generate simulated error vector. Default is NULL which adds no error to the DGP.

intercept

Scalar intercept term.

n, .n

Number of samples.

p, .p

Number of features.

return_support

Logical specifying whether or not to return a vector of the support column names. If X has no column names, then the indices of the support are used.

return_values

Character vector indicating what objects to return in list. Elements in vector must be one of "X", "y", "support".

support

Vector of feature indices in the true support of the DGP.

train_prop

Proportion of data in training set if data_split = TRUE.

X

Data matrix or data frame.

y

Response vector.

...

Other arguments to pass to err() to generate the error vector.

Value

A list of the named objects that were requested in return_values. See brief descriptions below.

X

A data.frame.

y

A response vector of length nrow(X).

support

A vector of feature indices indicating all features used in the true support of the DGP.

Note that if data_split = TRUE and "X", "y" are in return_values, then the returned list also contains slots for "Xtest" and "ytest".


Yu-Group/dgpoix documentation built on June 3, 2022, 1:40 a.m.