Description Usage Arguments Value Examples
View source: R/generate_normal.R
Creates a toy data set S = (X,Y) where the columns of X are sampled from an independent Gaussian distribution with mean μ_i and standard deviation σ_i, i.e. N(μ_i, σ_i^2). The response Y is given by Y = X^T β. The final dimension will be n \times (p + 1), with the number of data points n to be specified.
1 2 3 4 5 6 | generate_XY(
n = 100,
mu = rep(0, 10),
sigma = rep(1, 10),
beta_coefficients = 1:10
)
|
n |
desired number of data points in the data set. |
mu |
a p-dimensional vector of means for μ. |
sigma |
a p-dimensional vector of non-negative standard deviations for σ. |
beta_coefficients |
a p-dimensional vector of coefficients for β. |
An n \times (p+1) dimensional data frame given by S = (X,Y). In the base case, the columns X_i are sampled from N(0,1). We also have n = 100 and p = 10, with beta-coefficients 1 to 10.
1 2 3 | generate_XY()
generate_XY(n = 60, mu = 1:4, sigma = rep(1, 4), beta_coefficients = 1:4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.