dlaplace {vsgoftest}R Documentation

The Laplace distribution

Description

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

Usage

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\le x); otherwise P(X>x).

Details

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

f(x) = \frac{1}{2b}\exp(-\frac{|x-\mu|}{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

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

[Package vsgoftest version 1.0-1 Index]