splitn function

Split-normal distribution

Split-normal distribution

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

dsplitn(x, mu, sigma, lmd, logarithm) psplitn(q, mu, sigma, lmd) qsplitn(p, mu, sigma, lmd) rsplitn(n, mu, sigma, lmd)

Arguments

  • x: vector of quantiles.
  • mu: vector of location parameter. (The mode of the density)
  • sigma: vector of standard deviations.
  • lmd: vector of skewness parameters (>0). If is 1, reduced to symmetric normal distribution.
  • logarithm: logical; if TRUE, probabilities p are given as log(p).
  • q: vector of quantiles.
  • p: vector of probability.
  • n: number of observations. If length(n) > 1, the length is taken to be the number required.

Returns

dsplitn gives the density; psplitn gives the percentile; qsplitn gives the quantile; and rsplitn gives the random variables. Invalid arguments will result in return value NaN, with a warning.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Details

The random ' variable y follows a split-normal distribution, y~N(μ\mu, ' σ\sigma, λ\lambda), which has density:

1/(1+λ)σ(2/π)exp(yμ)2/2σ2,ify<=μ 1/(1+\lambda)\sigma ' \sqrt(2/\pi)exp{-(y-\mu)*2/2\sigma^2}, if y<=\mu

'

1/(1+λ)σ(2/π)exp(yμ)2/2σ2λ2,ify>μ 1/(1+\lambda)\sigma \sqrt(2/\pi)exp{-(y-\mu)*2/2\sigma^2 \lambda^2}, ' if y>\mu

where σ>0\sigma>0 and λ>0\lambda>0. The Split-normal ' distribution reduce to normal distribution when λ=1\lambda=1.

Functions

  • psplitn: Percentile for the split-normal distribution.
  • qsplitn: Quantile for the split-normal distribution.
  • rsplitn: Randon variables from the split-normal distribution.

Examples

n <- 3 mu <- c(0,1,2) sigma <- c(1,2,3) lmd <- c(1,2,3) q0 <- rsplitn(n, mu, sigma, lmd) d0 <- dsplitn(q0, mu, sigma, lmd, logarithm = FALSE) p0 <- psplitn(q0, mu, sigma, lmd) q1 <- qsplitn(p0,mu, sigma, lmd) all.equal(q0, q1)

References

Villani, M., & Larsson, R. (2006) The Multivariate Split Normal Distribution and Asymmetric Principal Components Analysis. Sveriges Riksbank Working Paper Series, No. 175.

See Also

splitn_mean(), splitn_var(),splitn_skewness() and splitn_kurtosis() for numerical characteristics of the split-normal distribution.

Author(s)

Feng Li, Jiayue Zeng

  • Maintainer: Jiayue Zeng
  • License: GPL (>= 2)
  • Last published: 2018-06-27