laplace: The Laplace (Double Exponential) Distribution

Description Usage Arguments Details Value See Also Examples

Description

Density, distribution function, quantile function and random generation for the Laplace (double exponential) distribution with mean mu and rate rate (i.e., mean 1/rate).

Usage

1
2
3
4
5
dlap(x, mu=0, rate=1)
plap(q, mu=0, rate=1)
qlap(p, mu=0, rate=1)
rlap(n, mu=0, rate=1)
fitlap(x,mu)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

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

mu

vector of means.

rate

vector of rates.

Details

If mu is not specified, it assumes the default value of 0.

If rate is not specified, it assumes the default value of 1.

Value

dlap gives the density, plap gives the distribution function, qlap gives the quantile function, and rlap generates random deviates.

See Also

exp for the exponential function.

Distributions for other standard distributions, including dgamma for the gamma distribution and dexp for the exponential distribution. dweibull for the Weibull distribution, both of which generalize the exponential.

Examples

1
2
3
4
5
6
7
8
9
  dlap(100)
  x <- rlap(1000,mu=0, rate=0.5)
  x0 = seq(-7,7, length=100)
  fitlap(x)
  plot(density(x), xlim=c(-7,7), ylim=c(0,0.35))
  (out = fitlap(x))
  lines(dlap(x0, out$mu, out$rate)~x0, col=2, lty=2)
  (out = fitlap(x, mu=0))
  lines(dlap(x0, out$mu, out$rate)~x0, col=4, lty=2)

bda documentation built on Jan. 5, 2018, 9:04 a.m.