Density, distribution function, quantile function, and random generation for the skew-normal distribution.

dsnorm(x, location = 0, scale = 1, shape = 0, log = FALSE)

psnorm(q, location = 0, scale = 1, shape = 0, log.p = FALSE, lower.tail = TRUE)

qsnorm(p, location = 0, scale = 1, shape = 0, log.p = FALSE, lower.tail = TRUE)

rsnorm(n, location = 0, scale = 1, shape = 0)

Arguments

x

Numeric vector of quantiles.

location

Numeric location parameter.

scale

Numeric scale parameter.

shape

Numeric shape parameter controlling skewness.

log

Logical. If TRUE, dsnorm() returns log-densities.

q

Numeric vector of quantiles.

log.p

Logical. If TRUE, probabilities are supplied or returned on the log scale.

lower.tail

Logical. If TRUE, probabilities are \(P[X \le x]\); otherwise, \(P[X > x]\).

p

Numeric vector of probabilities.

n

Number of observations.

Value

  • dsnorm() returns a numeric vector of density values.

  • psnorm() returns a numeric vector of probabilities.

  • qsnorm() returns a numeric vector of quantiles.

  • rsnorm() returns a numeric vector of random draws.

Note

Version 1.0.0.

Examples

dsnorm(c(-1, 0, 1), shape = 2)
#> [1] 0.01100973 0.39894228 0.47293172
psnorm(c(-1, 0, 1), shape = 2)
#> [1] 0.00171888 0.14758362 0.68440837
qsnorm(c(0.25, 0.75), shape = 2)
#> [1] 0.220710 1.148815

set.seed(1)
rsnorm(3, shape = 2)
#> [1] 0.2500524 0.4386953 0.7834062