dlaplace: The Laplace distribution

Description Usage Arguments Details Value Author(s) Examples

View source: R/external.R

Description

Density, cumulative distribution function, quantile function and random generation for the laplace distribution.

Usage

1
2
3
4
dlaplace(x, mu, b, log = FALSE)
plaplace(q, mu, b, lower.tail = TRUE, log.p = FALSE)
qlaplace(p, mu, b, lower.tail = TRUE, log.p = FALSE)
rlaplace(n, mu, b)

Arguments

x,q

(numeric, vector) a vector of quantiles.

p

(numeric, vector) a vector of probablities.

n

(numeric, vector) sample size to be generated.

mu

(numeric, single value) the location parameter.

b

(numeric, single value) the scale parameter.

log, log.p

(logical, single value) if TRUE, probabilities are given as \log(p). Default is FALSE.

lower.tail

(logical, single value) if TRUE (default), probabilities are P(X≤ x); otherwise P(X>x).

Details

The laplace distribution with shape parameter μ>0 and scale parameter b>0 has density

f(x) = \frac{1}{2b}\exp(-\frac{|x-μ|}{b}), \quad x \in R.

Value

dlaplace gives the density, plaplace gives the distribution function, qlaplace gives the quantile function, and rlaplace generates random deviates.

The length of the result is determined by n for rnorm, and is the maximum of the lengths of the numerical arguments for the other functions.

Author(s)

J. Lequesne justine.lequesne@unicaen.fr

Examples

1
2
set.seed(1)
rlaplace(100,mu=2,b=1)

pregnault/vsgoftest documentation built on Dec. 22, 2020, 8:55 a.m.