dskewlap function

Skew-Laplace Distribution

Skew-Laplace Distribution

Density function, distribution function, quantiles and random number generation for the skew-Laplace distribution.

dskewlap(x, Theta, logPars = FALSE) pskewlap(q, Theta) qskewlap(p, Theta) rskewlap(n, Theta)

Arguments

  • x, q: Vector of quantiles.
  • p: Vector of probabilities.
  • n: Number of observations to be generated.
  • Theta: Vector of parameters of the skew-Laplace distribution: alphaalpha, betabeta and mumu

.

  • logPars: Logical. If TRUE the first and second components of Theta are taken to be log(alpha) and log(beta) respectively.

Details

The central skew-Laplace has mode zero, and is a mixture of a (negative) exponential distribution with mean betabeta, and the negative of an exponential distribution with mean alphaalpha. The weights of the positive and negative components are proportional to their means.

The general skew-Laplace distribution is a shifted central skew-Laplace distribution, where the mode is given by mumu.

The density is given by:

f(x)=1α+βe(xμ)/α f(x)=\frac{1}{\alpha+\beta} e^{(x - \mu)/\alpha}%f(x)=(1/(alpha+beta)) e^((x - mu)/alpha)

for x<=mux <= mu, and

f(x)=1α+βe(xμ)/β f(x)=\frac{1}{\alpha+\beta} e^{-(x - \mu)/\beta}%f(x)=(1/(alpha+beta)) e^(-(x - mu)/beta)

for x>=mux >= mu

Returns

dskewlap gives the density, pskewlap gives the distribution function, qskewlap gives the quantile function and rskewlap

generates random variates. The distribution function is obtained by elementary integration of the density function. Random variates are generated from exponential observations using the characterization of the skew-Laplace as a mixture of exponential observations.

References

Fieller, N. J., Flenley, E. C. and Olbricht, W. (1992) Statistics of particle size data. Appl. Statist., 41 , 127--146.

Author(s)

David Scott d.scott@auckland.ac.nz , Ai-Wei Lee, Richard Trendall

See Also

hyperbFitStart

Examples

Theta <- c(1,2,1) par(mfrow = c(1,2)) curve(dskewlap(x, Theta), from = -5, to = 8, n = 1000) title("Density of the\n Skew-Laplace Distribution") curve(pskewlap(x, Theta), from = -5, to = 8, n = 1000) title("Distribution Function of the\n Skew-Laplace Distribution") dataVector <- rskewlap(500, Theta) curve(dskewlap(x, Theta), range(dataVector)[1], range(dataVector)[2], n = 500) hist(dataVector, freq = FALSE, add =TRUE) title("Density and Histogram\n of the Skew-Laplace Distribution") logHist(dataVector, main = "Log-Density and Log-Histogram\n of the Skew-Laplace Distribution") curve(log(dskewlap(x, Theta)), add = TRUE, range(dataVector)[1], range(dataVector)[2], n = 500)