getDist: Random Observations Generator

Description Usage Arguments Value **Note Examples

View source: R/UnivariateRandomNumberGenerator.R

Description

Random observations generator selected from several distributions with user defined mean and variance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
getDist(
  n,
  dist,
  mu,
  sigma,
  par.location = 0,
  par.scale = 1,
  par.shape = 1,
  dist.par = NULL,
  rounding.factor = NULL
)

Arguments

n

scalar. Number of observations to be generated.

dist

character string. Select from:

  • "Uniform: Continuous Uniform distribution .

  • "Normal": Normal distribution (default).

  • "Normal2": Squared Normal distribution (also known as Chi-squared).

  • "DoubleExp": Double exponential distribution (also known as Laplace distribution).

  • "DoubleExp2": Double exponential squared distribution from a DoubleExp(0,1).

  • "LogNormal": Lognormal distribution.

  • "Gamma": Gamma distribution.

  • "Weibull": Weibull distribution.

  • "t": Student-t distribution.

mu

scalar. Expected value of the desired distribution.

sigma

scalar. Standard deviation of the desired distribution.

par.location

scalar. Location parameter of the desired distribution. Default 0**.

par.scale

scalar. Scale parameter of the desired distribution. Default 1**.

par.shape

scalar. Shape parameter of the desired distribution, Default 1.

dist.par

vector. Overwrite par.location, par.scale, par.shape. Depends on the distribution (default NULL):

  • "Uniform: no matter how is defined always gives numbers between 0 and 1.

  • "Normal": c(location, scale).

  • "Normal2": c(location, scale).

  • "DoubleExp": c(location, scale).

  • "DoubleExp2": c(location, scale).

  • "LogNormal": c(location, scale).

  • "Gamma": c(scale, shape).

  • "Weibull": c(shape, scale).

  • "t": c(degrees of freedom).

rounding.factor

scalar. positive value that determine the range between two consecutive rounded values.

Value

A vector x with n observations generated following the selected distribution with its parameters.

**Note

Examples

1
getDist(1, "Normal", 0, 1)

SNSchart documentation built on April 7, 2021, 9:07 a.m.