powered by
Simulate an error term
make_error( n = 10, mu = 0, var = 1, method = c("normal", "laplace", "cauchy", "lognormal") )
A numeric vector
the number of values to simulate.
the sample average.
the sample variance. The sqrt(var) is passed to rnorm() and rlnorm() for normal and laplace distributions. sqrt(var / 2) is used for laplace() .
sqrt(var)
rnorm()
rlnorm()
sqrt(var / 2)
laplace()
must be one of "normal", "laplace", "cauchy", or "lognormal".
"normal"
"laplace"
"cauchy"
"lognormal"
"normal": fit with rnorm()
"laplace": fit with smoothmest::rdoublex()
smoothmest::rdoublex()
"cauchy": fit with rcauchy()
rcauchy()
"lognormal": fit with rlnorm()