Learn R Programming

VGAM (version 0.8-4.1)

Slash: Slash Distribution

Description

Density function, distribution function, and random generation for the slash distribution.

Usage

dslash(x, mu=0, sigma=1, log=FALSE, smallno=.Machine$double.eps*1000)
pslash(q, mu=0, sigma=1)
rslash(n, mu=0, sigma=1)

Arguments

x, q
vector of quantiles.
n
number of observations. Must be a single positive integer.
mu, sigma
the mean and standard deviation of the univariate normal distribution.
log
Logical. If TRUE then the logarithm of the density is returned.
smallno
See slash.

Value

  • dslash gives the density, and pslash gives the distribution function, rslash generates random deviates.

Details

See slash, the VGAM family function for estimating the two parameters by maximum likelihood estimation, for the formula of the probability density function and other details.

See Also

slash.

Examples

Run this code
curve(dslash, col="blue", ylab="f(x)", -5, 5, ylim=c(0,0.4),
     main="Standard slash, normal and Cauchy densities", lwd=2)
curve(dnorm, col="black", lty=2, lwd=2, add=TRUE)
curve(dcauchy, col="red", lty=3, lwd=2, add=TRUE)
legend(x=2, y=0.3, c("slash","normal","Cauchy"), lty=1:3,
       col=c("blue","black","red"), lwd=2)

curve(pslash, col="blue", -5, 5, ylim=0:1)

Run the code above in your browser using DataLab