Learn R Programming

jmuOutlier (version 2.2)

rlaplace: Laplace (Double Exponential) Random Generation

Description

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

Usage

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.

Value

rlaplace generates random deviates.

Details

The Laplace distribution has density \(e^{-|x-\mu| \sqrt{2} / \sigma} / (\sigma \sqrt{2}),\) where \(\mu\) is the mean of the distribution and \(\sigma\) is the standard deviation.

References

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

See Also

dlaplace, plaplace, and qlaplace.

Examples

Run this code
# NOT RUN {
# 20 random variates from a Laplace( 50, 10 ) distribution.

rlaplace( 20, 50, 10 )
# }

Run the code above in your browser using DataLab