Learn R Programming

smoothmest (version 0.1-3)

ddoublex: The double exponential (Laplace) distribution

Description

Density for and random values from double exponential (Laplace) distribution with density exp(-abs(x-mu)/lambda)/(2*lambda), for which the median is the ML estimator.

Usage

ddoublex(x, mu=0, lambda=1)
  rdoublex(n,mu=0,lambda=1)

Arguments

x

numeric vector.

mu

numeric. Distribution median.

lambda

numeric. Scale parameter.

n

integer. Number of random values to be generated.

Value

ddoublex gives out a vector of density values.

rdoublex gives out a vector of random numbers generated by the double exponential distribution.

Details

ddoublex:

density.

rdoublex:

random number generation.

References

Huber, P. J. and Ronchetti, E. (2009) Robust Statistics (2nd ed.). Wiley, New York.

Examples

Run this code
# NOT RUN {
  set.seed(123456)
  ddoublex(1:5,lambda=5)
  rdoublex(5,mu=10,lambda=5)
# }

Run the code above in your browser using DataLab