make_noise: Draw random values from an assortment of distributions

Description Usage Arguments Value Author(s) Examples

View source: R/make_noise.R

Description

Draw random values from an assortment of distributions

Usage

1
2
3
4
5
6
7
8
make_noise(
  n = 1,
  mu = 0,
  sd = 1,
  hi_lo = 1,
  error_type = "gaussian",
  symmetric = TRUE
)

Arguments

n

Number of observations Default = 1.

mu

Mean. Default = 0.

sd

Standard deviation. Default = 1.

hi_lo

A value to represent maximum value and minimum value for binomial distribution. or uniform distribution. A value of 2 will set a maximum of +2 and a minimum of -2. Default = 1.

error_type

Error distribution. Options include "gaussian", "binomial" and "uniform".

symmetric

Boolean indicating whether simulate symmetry. Default = TRUE. When FALSE, an absolute value is applied to the noise parameter to force assymmetry

Value

A numeric value or vector

Author(s)

Gary Cornwall and Jeffrey Chen

Examples

1
2
3
4
5
#Draw 100 from a binomial distribution of -3 and 3
make_noise(n = 100, error_type = "binomial", hi_lo = 3)

#Draw 1 value from a Gaussian distribution N(2,10)
make_noise(n = 1, error_type = "gaussian", mu = 2, sd = 10)

DataScienceForPublicPolicy/unitrootML documentation built on Dec. 17, 2021, 4:07 p.m.