The R package dng
(d
istributions an
d g
radients) provides efficient algorithms for density, distribution function, quantile function and random generation for the split normal and split-t distributions, and computes their mean, variance, skewness and kurtosis for the two distributions.
install.packages("dng")
You can install the development version of dng
package from
GitHub Repository with:
devtools::install_github("feng-li/dng")
library(dng)
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)
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)
- Li, Feng, Villani, Mattias, & Kohn, Robert. (2010). "Flexible modeling of conditional distributions using smooth mixtures of asymmetric student t densities". Journal of Statistical Planning & Inference, 140(12), 3638-3654.
This package is free and open source software, licensed under GPL-3.
Feng Li is supported by the National Natural Science Foundation of China.