Description Usage Arguments Details Value Author(s) References Examples
Density, probability, quantile, random number generation, and MLE functions for the asymmetric Laplace distribution with parameters either in ASL(theta, mu, sigma) or the alternative ASL*(theta, kappa, sigma).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dasl(x, theta = 0, mu = 0, sigma = 1, log = FALSE)
dasla(x, theta = 0, kappa = 1, sigma = 1, log = FALSE)
pasl(q, theta = 0, mu = 0, sigma = 1, lower.tail = TRUE,
log.p = FALSE)
pasla(q, theta = 0, kappa = 1, sigma = 1, lower.tail = TRUE,
log.p = FALSE)
qasl(p, theta = 0, mu = 0, sigma = 1, lower.tail = TRUE,
log.p = FALSE)
qasla(p, theta = 0, kappa = 1, sigma = 1, lower.tail = TRUE,
log.p = FALSE)
rasl(n, theta = 0, mu = 0, sigma = 1)
rasla(n, theta = 0, kappa = 1, sigma = 1)
asl.optim(x)
|
x, q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
theta |
center parameter. |
mu, kappa |
location parameters. |
sigma |
shape parameter. |
log, log.p |
logical; if |
lower.tail |
logical; if |
The density f(x) of ASL*(theta, kappa, sigma) is given as sqrt(2) / sigma kappa / (1 + κ^2) exp(- sqrt(2) kappa / sigma |x - θ|) if x >= theta, and sqrt(2) / sigma kappa / (1 + κ^2) exp(- sqrt(2) / (sigma kappa) |x - θ|) if x < theta.
The parameter domains of ASL and ASL* are theta in real, sigma > 0, kappa > 0, and mu in real. The relation of mu and kappa are kappa = (sqrt(2 sigma^2 + mu^2) - mu) / sqrt(2 sigma) or mu = sigma / sqrt(2) (1 / kappa - kappa).
“dasl” and “dasla” give the densities, “pasl” and “pasla” give the distribution functions, “qasl” and “qasla” give the quantile functions, and “rasl” and “rasls” give the random numbers.
asl.optim
returns the MLE of data x
including
theta
, mu
, kappa
, and sigma
.
Wei-Chen Chen wccsnow@gmail.com.
Kotz S, Kozubowski TJ, Podgorski K. (2001) “The Laplace distribution and generalizations: a revisit with applications to communications, economics, engineering, and finance.” Boston: Birkhauser.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
suppressMessages(library(cubfits, quietly = TRUE))
set.seed(1234)
dasl(-2:2)
dasla(-2:2)
pasl(-2:2)
pasla(-2:2)
qasl(seq(0, 1, length = 5))
qasla(seq(0, 1, length = 5))
dasl(-2:2, log = TRUE)
dasla(-2:2, log = TRUE)
pasl(-2:2, log.p = TRUE)
pasla(-2:2, log.p = TRUE)
qasl(log(seq(0, 1, length = 5)), log.p = TRUE)
qasla(log(seq(0, 1, length = 5)), log.p = TRUE)
set.seed(123)
rasl(5)
rasla(5)
asl.optim(rasl(5000))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.