Description Usage Arguments Details Value Author(s) References Examples
Density function, distribution function, quantiles and random number generation for the Generalised Normal Laplace distribution, with parameters mu (location), sigma (scale), alpha (shape), beta (shape) and rho (scale).
1 2 3 4 5 6 7 8 9 | dgnl(x, mu = 0, sigma = 1, alpha = 1, beta = 1, rho = 1,
param = c(mu, sigma, alpha, beta, rho))
pgnl(q, mu = 0, sigma = 1, alpha = 1, beta = 1, rho = 1,
param = c(mu, sigma, alpha, beta, rho))
qgnl(p, mu = 0, sigma = 1, alpha = 1, beta = 1, rho = 1,
param = c(mu, sigma, alpha, beta, rho),
tol = 10^(-5), nInterpol = 100, subdivisions = 100, ...)
rgnl(n, mu = 0, sigma = 1, alpha = 1, beta = 1, rho = 1,
param = c(mu, sigma, alpha, beta, rho))
|
x, q |
Vector of quantiles. |
p |
Vector of probabilities. |
n |
Number of random variates to be generated. |
mu |
Location parameter mu, default is 0. |
sigma |
Scale parameter sigma, default is 1. |
alpha |
Shape parameter alpha, default is 1. |
beta |
Shape parameter beta, default is 1. |
rho |
Scale parameter rho, default is 1. |
param |
Specifying the parameters as a vector of the form |
tol |
Specified level of tolerance when checking if parameter beta is equal to 0. |
subdivisions |
The maximum number of subdivisions used to integrate the density and determine the accuracy of the distribution function calculation. |
nInterpol |
Number of points used in |
... |
Passes arguments to |
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 characteristic function of the distribution is required to be evaluted and integrated over in order to obtain the density and distribution functions.
The characteristic function is
phi(s) = ((alpha * beta * exp((- sigma^2 * s^2) / 2)) / ((alpha - is)*(beta + is)))^rho
The density function is
f(x - mu) = (1/pi) * int_0^inf r(s)*cos(theta(s) - s*y)ds
Where r(s) and θ(s) are respectively the modulus and argument of the complex number returned from the characteristic function.
The distribution function is
F(x - mu = (1/2) + ((1/pi) * int_0^inf (r(s)/s) * sin(s*x - theta(s))ds
Generation of random observations from the Generalised Normal Laplace
distribution using rgnl
is based upon the composition of three
random variables, Z, G_1 and G_2. These are independent with
Z ~ N(0, 1) and G_1, G_2 being gamma random variables with a scale of 1
and a shape of ρ.
A GNL random variable, X ~ GNL(mu, sigma, alpha, beta, rho) can be represented as:
X = rho*mu + sigma*sqrt(rho)*Z + (1/alpha)G_1 - (1/beta)G_2
dgnl
gives the density function, pgnl
gives the
distribution function, qgnl
gives the quantile function and
rgnl
generates random variates.
Simon Potter
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.
William J. Reed. (2008) Maximum Likelihood Estimation for Brownian-Laplace Motion and the Generalized Normal-Laplace (GNL) Distribution. Submitted to COMPSTAT 2008.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | param <- c(0, 1, 3, 2, 1)
par(mfrow = c(1, 2))
## Curves of density and distribution
curve(dgnl(x, param = param), -5, 5, n = 1000)
title("Density of the Generalised Normal Laplace Distribution")
curve(pgnl(x, param = param), -5, 5, n = 1000)
title("Distribution Function of the Generalised Normal Laplace Distribution")
## Example of density and random numbers
par(mfrow = c(1, 1))
param1 <- c(0, 1, 1, 1, 1)
data1 <- rgnl(1000, param = param1)
curve(dgnl(x, param = param1),
from = -5, to = 5, n = 1000, col = 2)
hist(data1, freq = FALSE, add = TRUE)
title("Density and Histogram")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.