gen.gaussian.data | R Documentation |
Simulate a data set with gaussian response following the linear regression model.
gen.gaussian.data( n, p, rho = 0, kappa = 5, beta.type = 1, snr = 1, seed = 2021 )
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. |
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. |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.