View source: R/dgp-lib-errors.R
norm_errors | R Documentation |
Generate independent Gaussian errors with variance proportional to norm of row observations in the data matrix X. That is, epsilon_i ~ N(0, scale * ||x_i||_2^2).
norm_errors(X, scale = 1)
X |
Data matrix or data frame. |
scale |
Multiplicative scale factor. |
A vector of simulated errors with length n
.
errs <- norm_errors(X = iris %>% dplyr::select(-Species))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.