| make_sparse_model {natural} | R Documentation |
Generate sparse linear model and random samples
Description
Generate design matrix and response following linear models
y = X \beta + \epsilon, where
\epsilon ~ N(0, \sigma^2), and X ~ N(0, \Sigma).
Usage
make_sparse_model(n, p, alpha, rho, snr, nsim)
Arguments
n |
the sample size |
p |
the number of features |
alpha |
sparsity, i.e., |
rho |
pairwise correlation among features |
snr |
signal to noise ratio, defined as |
nsim |
the number of simulations |
Value
A list object containing:
x:The
nbypdesign matrixy:The
nbynsimmatrix of response vector, each column representing one replication of the simulationbeta:The true regression coefficient vector
sigma:The true error standard deviation
[Package natural version 0.9.0 Index]