getDist {SNSchart} | R Documentation |
Random Observations Generator
Description
Random observations generator selected from several distributions with user defined mean and variance.
Usage
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:
|
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
|
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
For "Lognormal",
par.location
andpar.scale
correspond to the location and scale parameters of the normal distribution that generales the lognormal. Hence, in this case they are the logmean and the logsigma parametersFor "Normal2" and "DoubleExp2",
par.location
andpar.scale
correspond correspond to the location and scale parameters of the normal and double exponential that are used to generates their squared forms.
Examples
getDist(1, "Normal", 0, 1)