simplex {simplexreg} | R Documentation |
The Simplex Distribution Functions
Description
Density, cumulative distribution function, quantile function and random variable generation
for the simplex distribution with mean equal to mu
and dispersion equal to sig
Usage
dsimplex(x, mu, sig)
psimplex(q, mu, sig)
qsimplex(p, mu, sig)
rsimplex(n, mu, sig)
psimplex.norm(q, mu, sig)
qsimplex.norm(p, mu, sig)
Arguments
x , q |
vector of quantiles |
p |
vector of probabilities |
n |
number of observations |
mu |
vector of means |
sig |
vector of square root of dispersion parameter of simplex distribution |
Details
The simplex distribution has density
where is a unit deviance function
is the mean of simplex distribution and
the dispersion parameter.
qnorm
provides results up to about 6 digits.
Value
dsimplex
gives density function, psimplex
gives the distribution function, qsimplex
gives quantile function and
rsimplex
gives random number generated from the simplex distribution. psim.norm
and qsimplex.norm
gives the
renormalized distribution and quantile function.
Author(s)
Peng Zhang and Zhenguo Qiu
References
Barndorff-Nielsen, O.E. and Jorgensen, B. (1991) Some parametric models on the simplex. Journal of Multivariate Analysis, 39: 106–116
Jorgensen, B. (1997) The Theory of Dispersion Models. London: Chapman and Hall
Song, P. and Qiu, Z. and Tan, M. (2004) Modelling Heterogeneous Dispersion in Marginal Models for Longitudinal Proportional Data. Biometrical Journal, 46: 540–553
Examples
# simplex distribution function
dsimplex(seq(0.01,0.99,0.01), 0.5, 1)
psimplex(seq(0.01,0.99,0.01), 0.5, 1)
qsimplex(seq(0.01,0.99,0.01), 0.5, 1)
# random variable generation
n <- 200
ga0 <- 1.5
ga1 <- 0.5
ga2 <- -0.5
sigma <- 4
T <- c(rep(0, n/2), rep(1, n/2))
S <- runif(n, 0, 5)
eta <- ga0 + ga1 * T + ga2 * S
mu <- exp(eta)/(1+exp(eta))
Y <- rep(0, n)
for (i in 1:n){
Y[i] <- rsimplex(1, mu[i], sigma)
}