gendata_Reg {TOSI} | R Documentation |
Generate simulated data
Description
Generate simulated data from high-dimensional sparse regression model.
Usage
gendata_Reg(n=100, p = 20, s0=5, rho=1, seed=1)
Arguments
n |
a positive integer, the sample size, default as 100. |
p |
an positive integer, the dimension of covriates, default as 20. |
s0 |
a positive integer, the number of nonzero components of regression coefficients, default as 5. |
rho |
a positive number, controlling the magnitude of coefficients. |
seed |
a nonnegative integer, the random seed, default as 1. |
Value
return a list including two components:
Y |
a |
X |
a |
beta0 |
a p-dimensional vector, the Reg. coefficients. |
index_nz |
a integer vector, the index of nonzero components of Reg. coefficients. |
Note
nothing
Author(s)
Liu Wei
Examples
dat <- gendata_Reg(n=100, p = 100, s0=3)
str(dat)
[Package TOSI version 0.3.0 Index]