NormalLaplace: Normal Laplace Distribution

NormalLaplaceDistributionR Documentation

Normal Laplace Distribution


Density function, distribution function, quantiles and random number generation for the normal Laplace distribution, with parameters \mu (location), \delta (scale), \beta (skewness), and \nu (shape).


dnl(x, mu = 0, sigma = 1, alpha = 1, beta = 1,
    param = c(mu,sigma,alpha,beta))
pnl(q, mu = 0, sigma = 1, alpha = 1, beta = 1,
    param = c(mu,sigma,alpha,beta))
qnl(p, mu = 0, sigma = 1, alpha = 1, beta = 1,
    param = c(mu,sigma,alpha,beta),
    tol = 10^(-5), nInterpol = 100, subdivisions = 100, ...)
rnl(n, mu = 0, sigma = 1, alpha = 1, beta = 1,
    param = c(mu,sigma,alpha,beta))


x, q

Vector of quantiles.


Vector of probabilities.


Number of random variates to be generated.


Location parameter \mu, default is 0.


Scale parameter \sigma, default is 1.


Skewness parameter \alpha, default is 1.


Shape parameter \beta, default is 1.


Specifying the parameters as a vector of the form


Specified level of tolerance when checking if parameter beta is equal to 0.


The maximum number of subdivisions used to integrate the density and determine the accuracy of the distribution function calculation.


Number of points used in qnl for cubic spline interpolation of the distribution function.


Passes arguments to uniroot.


Users may either specify the values of the parameters individually or as a vector. If both forms are specified, then the values specified by the vector param will overwrite the other ones.

The density function is

f(y)=\frac{\alpha\beta}{\alpha+\beta}\phi\left(\frac{y-\mu}{\sigma }% \right)\left[R\left(\alpha\sigma-\frac{(y-\mu)}{\sigma}\right)+% R\left(\beta \sigma+\frac{(y-\mu)}{\sigma}\right)\right]

The distribution function is

F(y)=\Phi\left(\frac{y-\mu}{\sigma}\right)-% \phi\left(\frac{y-\mu}{\sigma}\right)% \left[\beta R(\alpha\sigma-\frac{y-\mu}{\sigma})-% \alpha R\left(\beta\sigma+\frac{y-\mu}{\sigma}\right)\right]/% (\alpha+\beta)

The function R(z) is the Mills' Ratio, see millsR.

Generation of random observations from the normal Laplace distribution using rnl is based on the representation

Y\sim Z+W

where Z and W are independent random variables with

Z\sim N(\mu,\sigma^2)

and W following an asymmetric Laplace distribution with pdf

f_W(w) = \left\{ \begin{array}{ll}% (\alpha\beta)/(\alpha+\beta)e^{\beta w} & \textrm{for $w\le0$}\\ % (\alpha\beta)/(\alpha+\beta)e^{-\beta w} & \textrm{for $w>0$}% \end{array} \right.


dnl gives the density function, pnl gives the distribution function, qnl gives the quantile function and rnl generates random variates.


David Scott, Jason Shicong Fu


William J. Reed. (2006) The Normal-Laplace Distribution and Its Relatives. In Advances in Distribution Theory, Order Statistics and Inference, pp. 61–74. Birkhäuser, Boston.


param <- c(0,1,3,2)
par(mfrow = c(1,2))

## Curves of density and distribution
curve(dnl(x, param = param), -5, 5, n = 1000)
title("Density of the Normal Laplace Distribution")
curve(pnl(x, param = param), -5, 5, n = 1000)
title("Distribution Function of the Normal Laplace Distribution")

## Example of density and random numbers
 par(mfrow = c(1,1))
 param1  <-  c(0,1,1,1)
 data1  <-  rnl(1000, param = param1)
 curve(dnl(x, param = param1),
       from = -5, to = 5, n = 1000, col = 2)
 hist(data1, freq = FALSE, add = TRUE)
 title("Density and Histogram")

NormalLaplace documentation built on Nov. 26, 2023, 1:07 a.m.