powered by
Generate simulated data from high-dimensional sparse regression model.
gendata_Reg(n=100, p = 20, s0=5, rho=1, seed=1)
return a list including two components:
a n-dimensional vector, the observed response vector.
n
a n-by-p matrix, the observed covariates matrix.
p
a p-dimensional vector, the Reg. coefficients.
a integer vector, the index of nonzero components of Reg. coefficients.
a positive integer, the sample size, default as 100.
an positive integer, the dimension of covriates, default as 20.
a positive integer, the number of nonzero components of regression coefficients, default as 5.
a positive number, controlling the magnitude of coefficients.
a nonnegative integer, the random seed, default as 1.
Liu Wei
dat <- gendata_Reg(n=100, p = 100, s0=3) str(dat)
Run the code above in your browser using DataLab