dist.Skew.Discrete.Laplace: Skew Discrete 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 discrete Laplace distribution with parameters p and q.

Usage

1
2
3
4
dsdlaplace(x, p, q, log=FALSE)
psdlaplace(x, p, q)
qsdlaplace(prob, p, q)
rsdlaplace(n, p, q)

Arguments

x

This is a vector of data.

p

This is a scalar or vector of parameter p in [0,1].

q

This is a scalar or vector of parameter q in [0,1].

prob

This is a probability scalar or vector.

n

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

log

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

Details

This is a discrete form of the skew-Laplace distribution. The symmetric discrete Laplace distribution occurs when p=q. DL(p,0) is a geometric distribution, and DL(0,q) is a geometric distribution of non-positive integers. The distribution is degenerate when DL(0,0). Since the geometric distribution is a discrete analog of the exponential distribution, the distribution of the difference of two geometric variables is a discrete Laplace distribution.

These functions are similar to those in the DiscreteLaplace package.

Value

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

References

Kozubowski, T.J. and Inusah, S. (2006). "A Skew Laplace Distribution on Integers". AISM, 58, p. 555–571.

See Also

dalaplace, dexp, dlaplace, dlaplacep, and dslaplace.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(LaplacesDemonCpp)
x <- dsdlaplace(1,0.5,0.5)
x <- psdlaplace(1,0.5,0.5)
x <- qsdlaplace(0.5,0.5,0.5)
x <- rsdlaplace(5,0.5,0.5)

#Plot Probability Functions
     x <- c(-3:3)
     plot(x, dsdlaplace(x,0.5,0.5), ylim=c(0,0.6), type="l", main="Probability Function",
          ylab="density", col="red")
     lines(x, dsdlaplace(x,0.3,0.6), type="l", col="green")
     lines(x, dsdlaplace(x,0.9,0.1), type="l", col="blue")
     legend(-2.5, 0.5, expression(paste(p==0.5, ", ", q==0.5),
          paste(p==0.3, ", ", q==0.6),
          paste(p==0.9, ", ", q==0.1)),
          lty=c(1,1,1), col=c("red","green","blue"))

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