Generate simulated data for sparse group linear model.
gen.data(
n,
m,
d,
s,
s0,
cor.type = 1,
beta.type = 1,
rho = 0.5,
sigma1 = 1,
sigma2 = 1,
seed = 1
)A list object comprising:
Design matrix of predictors.
Response variable.
The coefficients used in the underlying regression model.
The group index of each variable.
The important groups in the sparse group linear model.
The important variables in the sparse group linear model.
The number of observations.
The number of groups of interest.
The group size of each group. Only even group structure is allowed here.
The number of important groups in the underlying regression model.
The number of important variables in each important group.
The structure of correlation.
cor.type = 1 denotes the independence structure,
where the covariance matrix has \((i,j)\) entry equals \(I(i \neq j)\).
cor.type = 2 denotes the exponential structure,
where the covariance matrix has \((i,j)\) entry equals \(rho^{|i-j|}\).
cor.type = 3 denotes the constant structure,
where the non-diagonal entries of covariance
matrix are \(rho\) and diagonal entries are 1.
The structure of coefficients.
beta.type = 1 denotes the homogenous setup,
where each entry has the same magnitude.
beta.type = 2 denotes the heterogeneous structure,
where the coefficients are drawn from a normal distribution.
A parameter used to characterize the pairwise correlation in
predictors. Default is 0.5..
The value controlling the strength of the gaussian noise. A large value implies strong noise. Default sigma1 = 1.
The value controlling the strength of the coefficients. A large value implies large coefficients. Default sigma2 = 1.
random seed. Default: seed = 1.
Yanhang Zhang, Zhifan Li, Jianxin Yin.
# Generate simulated data
n <- 200
m <- 100
d <- 10
s <- 5
s0 <- 5
data <- gen.data(n, m, d, s, s0)
str(data)
Run the code above in your browser using DataLab