lsl | R Documentation |
Density, distribution function, quantile function, and random
generation for the log-slash distribution with parameters mu
,
sigma
, and nu
.
dlsl(x, mu, sigma, nu, log = FALSE, ...)
plsl(q, mu, sigma, nu, lower.tail = TRUE, ...)
qlsl(p, mu, sigma, nu, lower.tail = TRUE, ...)
rlsl(n, mu, sigma, nu)
x, q |
vector of positive quantiles. |
mu |
vector of strictly positive scale parameters. |
sigma |
vector of strictly positive relative dispersion parameters. |
nu |
strictly positive heavy-tailedness parameter. |
log |
logical; if |
... |
further arguments. |
lower.tail |
logical; if |
p |
vector of probabilities. |
n |
number of random values to return. |
A random variable X has a log-slash distribution with parameter mu
and
sigma
if log(X) follows a slash distribution with location parameter log(mu)
and dispersion parameter sigma
. It can be showed that mu
is the median of X.
dlsl
returns the density, plsl
gives the distribution
function, qlsl
gives the quantile function, and rlsl
generates random observations.
Invalid arguments will result in return value NaN
.
The length of the result is determined by n
for rlsl
, and is the
maximum of the lengths of the numerical arguments for the other functions.
Rodrigo M. R. de Medeiros <rodrigo.matheus@live.com>
Vanegas, L. H., and Paula, G. A. (2016). Log-symmetric distributions: statistical properties and parameter estimation. Brazilian Journal of Probability and Statistics, 30, 196-220.
mu <- 8
sigma <- 0.4
nu <- 10
# Sample generation
x <- rlsl(10000, mu, sigma, nu)
# Density
hist(x, prob = TRUE, main = "The Log-Slash Distribution", col = "white")
curve(dlsl(x, mu, sigma, nu), add = TRUE, col = 2, lwd = 2)
legend("topright", "Probability density function", col = 2, lwd = 2, lty = 1)
# Distribution function
plot(ecdf(x), main = "The Log-Slash Distribution", ylab = "Distribution function")
curve(plsl(x, mu, sigma, nu), add = TRUE, col = 2, lwd = 2)
legend("bottomright", c("Emp. distribution function", "Theo. distribution function"),
col = c(1, 2), lwd = 2, lty = c(1, 1)
)
# Quantile function
plot(seq(0.01, 0.99, 0.001), quantile(x, seq(0.01, 0.99, 0.001)),
type = "l",
xlab = "p", ylab = "Quantile function", main = "The Log-Slash Distribution"
)
curve(qlsl(x, mu, sigma, nu), add = TRUE, col = 2, lwd = 2, from = 0, to = 1)
legend("topleft", c("Emp. quantile function", "Theo. quantile function"),
col = c(1, 2), lwd = 2, lty = c(1, 1)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.