Random observations generator selected from several distributions with user defined mean and variance.
getDist(
n,
dist,
mu,
sigma,
par.location = 0,
par.scale = 1,
par.shape = 1,
dist.par = NULL,
rounding.factor = NULL
)
scalar. Number of observations to be generated.
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.
scalar. Expected value of the desired distribution.
scalar. Standard deviation of the desired distribution.
scalar. Location parameter of the desired distribution. Default 0**.
scalar. Scale parameter of the desired distribution. Default 1**.
scalar. Shape parameter of the desired distribution, Default 1.
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).
scalar. positive value that determine the range between two consecutive rounded values.
A vector x
with n
observations generated following the selected distribution with its parameters.
For "Lognormal", par.location
and par.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 parameters
For "Normal2" and "DoubleExp2", par.location
and par.scale
correspond
correspond to the location and scale parameters of the normal and double exponential
that are used to generates their squared forms.
# NOT RUN {
getDist(1, "Normal", 0, 1)
# }
Run the code above in your browser using DataLab