Skip to contents

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).

Usage

norm_errors(X, scale = 1)

Arguments

X

Data matrix or data frame.

scale

Multiplicative scale factor.

Value

A vector of simulated errors with length n.

Examples

errs <- norm_errors(X = iris %>% dplyr::select(-Species))