gen.gaussian.data {glmtlp} | R Documentation |
Simulate a gaussian data set
Description
Simulate a data set with gaussian response following the linear regression model.
Usage
gen.gaussian.data(
n,
p,
rho = 0,
kappa = 5,
beta.type = 1,
snr = 1,
seed = 2021
)
Arguments
n |
Sample size. |
p |
Number of covariates. |
rho |
The parameter defining the AR(1) correlation matrix. |
kappa |
The number of nonzero coefficients. |
beta.type |
Numeric indicator for choosing the beta type. For
|
snr |
Signal-to-noise ratio. Default is 1. |
seed |
The seed for reproducibility. Default is 2021. |
Value
A list containing the simulated data.
X |
the covariate matrix, of dimension |
y |
the response, of length |
beta |
the true coefficients, of length |
sigma |
the standard error of the noise. |
Examples
gau_data <- gen.gaussian.data(n = 200, p = 20, seed = 2021)
head(gau_data$X)
head(gau_data$y)
head(gau_data$beta)
gau_data$sigma