Skip to contents

Simulate an error term

Usage

make_error(
  n = 10,
  mu = 0,
  var = 1,
  method = c("normal", "laplace", "cauchy", "lognormal")
)

Arguments

n

the number of values to simulate.

mu

the sample average.

var

the sample variance. The sqrt(var) is passed to rnorm() and rlnorm() for normal and laplace distributions. sqrt(var / 2) is used for laplace() .

method

must be one of "normal", "laplace", "cauchy", or "lognormal".

Value

A numeric vector

Details