rlaplace: Laplace (Double Exponential) Random Generation

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/rlaplace.R

Description

Laplace (double exponential) random generation with mean equal to mean and standard deviation equal to sd.

Usage

1
rlaplace(n, mean = 0, sd = 1)

Arguments

n

Number of observations. If length(n)>1, the length is taken to be the number required.

mean

Population mean.

sd

Population standard deviation.

Details

The Laplace distribution has density e^{-|x-μ| √{2} / σ} / (σ √{2}), where μ is the mean of the distribution and σ is the standard deviation.

Value

rlaplace generates random deviates.

Note

The formulas computed within rlaplace are based on the textbook by Higgins (2004).

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

References

Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.

See Also

dlaplace, plaplace, and qlaplace.

Examples

1
2
3
# 20 random variates from a Laplace( 50, 10 ) distribution.

rlaplace( 20, 50, 10 )

Example output

 [1] 48.10075 77.01607 46.61319 50.80744 30.85248 55.99545 45.46737 49.55366
 [9] 46.73511 47.23211 46.96970 63.43358 35.87802 46.10678 48.72790 61.24212
[17] 33.96689 56.00097 51.43395 44.94936

jmuOutlier documentation built on Aug. 6, 2019, 1:03 a.m.