Description Usage Arguments Details Value References See Also Examples
These functions provide the density, distribution function, quantile function, and random generation for the univariate, skew-Laplace distribution with location parameter mu, and two mixture parameters: alpha and beta.
1 2 3 4 |
x, q |
These are each a vector of quantiles. |
p |
This is a vector of probabilities. |
n |
This is the number of observations, which must be a positive integer that has length 1. |
mu |
This is the location parameter mu. |
alpha |
This is a mixture parameter alpha, which must be positive. |
beta |
This is a mixture parameter beta, which must be positive. |
log |
Logical. If |
Application: Continuous Univariate
Density 1: p(theta) = (1/(alpha+beta)) exp((theta-mu)/alpha), theta <= mu
Density 2: p(theta) = (1/(alpha+beta)) exp((mu-theta)/beta), theta > mu
Inventor: Fieller, et al. (1992)
Notation 1: theta ~ SL(mu, alpha, beta)
Notation 2: p(theta) = SL(theta | mu, alpha, beta)
Parameter 1: location parameter mu
Parameter 2: mixture parameter alpha > 0
Parameter 3: mixture parameter beta > 0
Mean: E(theta) = mu + beta - alpha
Variance: var(theta) = alpha^2 + beta^2
Mode: mode(theta) = mu
This is the three-parameter general skew-Laplace distribution, which is an extension of the two-parameter central skew-Laplace distribution. The general form allows the mode to be shifted along the real line with parameter mu. In contrast, the central skew-Laplace has mode zero, and may be reproduced here by setting mu=0.
The general skew-Laplace distribution is a mixture of a negative exponential distribution with mean beta, and the negative of an exponential distribution with mean alpha. The weights of the positive and negative components are proportional to their means. The distribution is symmetric when alpha=beta, in which case the mean is mu.
These functions are similar to those in the HyperbolicDist
package.
dslaplace
gives the density,
pslaplace
gives the distribution function,
qslaplace
gives the quantile function, and
rslaplace
generates random deviates.
Fieller, N.J., Flenley, E.C., and Olbricht, W. (1992). "Statistics of Particle Size Data". Applied Statistics, 41, p. 127–146.
dalaplace
,
dexp
,
dlaplace
,
dlaplacep
, and
dsdlaplace
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(LaplacesDemon)
x <- dslaplace(1,0,1,1)
x <- pslaplace(1,0,1,1)
x <- qslaplace(0.5,0,1,1)
x <- rslaplace(100,0,1,1)
#Plot Probability Functions
x <- seq(from=0.1, to=3, by=0.01)
plot(x, dslaplace(x,0,1,1), ylim=c(0,1), type="l", main="Probability Function",
ylab="density", col="red")
lines(x, dslaplace(x,0,0.5,2), type="l", col="green")
lines(x, dslaplace(x,0,2,0.5), type="l", col="blue")
legend(1.5, 0.9, expression(paste(mu==0, ", ", alpha==1, ", ", beta==1),
paste(mu==0, ", ", alpha==0.5, ", ", beta==2),
paste(mu==0, ", ", alpha==2, ", ", beta==0.5)),
lty=c(1,1,1), col=c("red","green","blue"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.