r.sample {asymmetry.measures}R Documentation

Switch between a range of available random number generators.

Description

Generate a random sample of size n out of a range of available distributions.

Usage

r.sample(s, dist, p1=0, p2=1)

Arguments

s

A scalar which specifies the size of the random sample drawn.

dist

Character string, used as a switch to the user selected distribution function (see details below).

p1

A scalar. Parameter 1 (vector or object) of the selected distribution.

p2

A scalar. Parameter 2 (vector or object) of the selected distribution.

Details

Based on user-specified argument dist, the function returns a random sample of size s from the corresponding distribution.

Supported distributions (along with the corresponding dist values) are:

Value

A vector of random values at the user specified points s.

Author(s)

Dimitrios Bagkavos and Lucia Gamez Gallardo

R implementation and documentation: Dimitrios Bagkavos <dimitrios.bagkavos@gmail.com> , Lucia Gamez Gallardo <gamezgallardolucia@gmail.com>

References

Bagkavos D., Patil P.N., Wood A.T.A. (2016), A Numerical Study of the Power Function of a New Symmetry Test. In: Cao R., Gonzalez Manteiga W., Romo J. (eds) Nonparametric Statistics. Springer Proceedings in Mathematics and Statistics, vol 175, Springer.

See Also

d.sample, q.sample, p.sample

Examples

selected.r <- "norm" #select Normal as the distribution
shape <- 2  # specify shape parameter
scale <- 1  # specify scale parameter
n <- 100    # specify sample size
r.sample(n,selected.r,shape,scale)  # calculate CDF at the designated point

[Package asymmetry.measures version 0.2 Index]