dist.Skew.Laplace: Skew-Laplace Distribution: Univariate

Description Usage Arguments Details Value References See Also Examples

Description

These functions provide the density, distribution function, quantile function, and random generation for the univariate, skew-Laplace distribution with location parameter mu, and two mixture parameters: alpha and beta.

Usage

1
2
3
4
dslaplace(x, mu, alpha, beta, log=FALSE)
pslaplace(q, mu, alpha, beta)
qslaplace(p, mu, alpha, beta)
rslaplace(n, mu, alpha, beta)

Arguments

x, q

These are each a vector of quantiles.

p

This is a vector of probabilities.

n

This is the number of observations, which must be a positive integer that has length 1.

mu

This is the location parameter mu.

alpha

This is a mixture parameter alpha, which must be positive.

beta

This is a mixture parameter beta, which must be positive.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Details

This is the three-parameter general skew-Laplace distribution, which is an extension of the two-parameter central skew-Laplace distribution. The general form allows the mode to be shifted along the real line with parameter mu. In contrast, the central skew-Laplace has mode zero, and may be reproduced here by setting mu=0.

The general skew-Laplace distribution is a mixture of a negative exponential distribution with mean beta, and the negative of an exponential distribution with mean alpha. The weights of the positive and negative components are proportional to their means. The distribution is symmetric when alpha=beta, in which case the mean is mu.

These functions are similar to those in the HyperbolicDist package.

Value

dslaplace gives the density, pslaplace gives the distribution function, qslaplace gives the quantile function, and rslaplace generates random deviates.

References

Fieller, N.J., Flenley, E.C., and Olbricht, W. (1992). "Statistics of Particle Size Data". Applied Statistics, 41, p. 127–146.

See Also

dalaplace, dexp, dlaplace, dlaplacep, and dsdlaplace.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(LaplacesDemonCpp)
x <- dslaplace(1,0,1,1)
x <- pslaplace(1,0,1,1)
x <- qslaplace(0.5,0,1,1)
x <- rslaplace(100,0,1,1)

#Plot Probability Functions
x <- seq(from=0.1, to=3, by=0.01)
plot(x, dslaplace(x,0,1,1), ylim=c(0,1), type="l", main="Probability Function",
     ylab="density", col="red")
lines(x, dslaplace(x,0,0.5,2), type="l", col="green")
lines(x, dslaplace(x,0,2,0.5), type="l", col="blue")
legend(1.5, 0.9, expression(paste(mu==0, ", ", alpha==1, ", ", beta==1),
     paste(mu==0, ", ", alpha==0.5, ", ", beta==2),
     paste(mu==0, ", ", alpha==2, ", ", beta==0.5)),
     lty=c(1,1,1), col=c("red","green","blue"))

LaplacesDemonR/LaplacesDemonCpp documentation built on May 7, 2019, 12:43 p.m.