# simplex: The Simplex Distribution Functions In simplexreg: Regression Analysis of Proportional Data Using Simplex Distribution

## 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

 1 2 3 4 5 6 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

p(y) = (2π σ^2)^{-1/2} (y(1-y))^{-3/2} e^(-1 / (2 σ^2) d(y;μ))

where d(y;μ) is a unit deviance function

d(y;μ) = (y - μ)^2 / (y(1-y) μ^2 (1-μ)^2)

μ is the mean of simplex distribution and σ^2 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

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # 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) }

### Example output

[1] 2.215920e-82 2.094683e-39 3.396319e-25 3.795463e-18 5.944866e-14
[6] 3.530480e-11 3.254723e-09 9.407381e-08 1.258514e-06 9.838155e-06
[11] 5.210578e-05 2.062984e-04 6.534921e-04 1.738330e-03 4.022890e-03
[16] 8.316709e-03 1.567241e-02 2.734559e-02 4.472549e-02 6.924763e-02
[21] 1.023007e-01 1.451385e-01 1.988047e-01 2.640753e-01 3.414205e-01
[26] 4.309855e-01 5.325887e-01 6.457332e-01 7.696306e-01 9.032315e-01
[31] 1.045262e+00 1.194264e+00 1.348632e+00 1.506657e+00 1.666558e+00
[36] 1.826522e+00 1.984733e+00 2.139403e+00 2.288794e+00 2.431243e+00
[41] 2.565180e+00 2.689143e+00 2.801795e+00 2.901933e+00 2.988497e+00
[46] 3.060579e+00 3.117429e+00 3.158460e+00 3.183247e+00 3.191538e+00
[51] 3.183247e+00 3.158460e+00 3.117429e+00 3.060579e+00 2.988497e+00
[56] 2.901933e+00 2.801795e+00 2.689143e+00 2.565180e+00 2.431243e+00
[61] 2.288794e+00 2.139403e+00 1.984733e+00 1.826522e+00 1.666558e+00
[66] 1.506657e+00 1.348632e+00 1.194264e+00 1.045262e+00 9.032315e-01
[71] 7.696306e-01 6.457332e-01 5.325887e-01 4.309855e-01 3.414205e-01
[76] 2.640753e-01 1.988047e-01 1.451385e-01 1.023007e-01 6.924763e-02
[81] 4.472549e-02 2.734559e-02 1.567241e-02 8.316709e-03 4.022890e-03
[86] 1.738330e-03 6.534921e-04 2.062984e-04 5.210578e-05 9.838155e-06
[91] 1.258514e-06 9.407381e-08 3.254723e-09 3.530480e-11 5.944866e-14
[96] 3.795463e-18 3.396319e-25 2.094683e-39 2.215920e-82
[1] 1.105243e-86 4.169175e-43 1.517510e-28 3.008265e-21 7.346963e-17
[6] 6.270512e-14 7.853569e-12 2.959700e-10 5.003099e-09 4.821303e-08
[11] 3.085591e-07 1.452133e-06 5.392932e-06 1.662296e-05 4.413063e-05
[16] 1.037508e-04 2.206481e-04 4.315755e-04 7.865771e-04 1.349898e-03
[21] 2.199981e-03 3.428552e-03 5.138877e-03 7.443362e-03 1.046067e-02
[26] 1.431254e-02 1.912054e-02 2.500282e-02 3.207108e-02 4.042780e-02
[31] 5.016383e-02 6.135630e-02 7.406701e-02 8.834114e-02 1.042064e-01
[36] 1.216725e-01 1.407310e-01 1.613554e-01 1.835014e-01 2.071081e-01
[41] 2.320979e-01 2.583784e-01 2.858431e-01 3.143726e-01 3.438364e-01
[46] 3.740942e-01 4.049972e-01 4.363901e-01 4.681123e-01 5.000000e-01
[51] 5.318877e-01 5.636099e-01 5.950028e-01 6.259058e-01 6.561636e-01
[56] 6.856274e-01 7.141569e-01 7.416216e-01 7.679021e-01 7.928919e-01
[61] 8.164986e-01 8.386446e-01 8.592690e-01 8.783275e-01 8.957936e-01
[66] 9.116589e-01 9.259330e-01 9.386437e-01 9.498362e-01 9.595722e-01
[71] 9.679289e-01 9.749972e-01 9.808795e-01 9.856875e-01 9.895393e-01
[76] 9.925566e-01 9.948611e-01 9.965714e-01 9.978000e-01 9.986501e-01
[81] 9.992134e-01 9.995684e-01 9.997794e-01 9.998962e-01 9.999559e-01
[86] 9.999834e-01 9.999946e-01 9.999985e-01 9.999997e-01 1.000000e+00
[91] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
[96] 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
[1] 0.2486278 0.2716244 0.2872461 0.2995250 0.3098433 0.3188556 0.3269300
[8] 0.3342920 0.3410947 0.3474447 0.3534200 0.3590806 0.3644722 0.3696311
[15] 0.3745872 0.3793650 0.3839844 0.3884628 0.3928141 0.3970515 0.4011856
[22] 0.4052256 0.4091806 0.4130572 0.4168622 0.4206022 0.4242817 0.4279061
[29] 0.4314794 0.4350061 0.4384894 0.4419333 0.4453406 0.4487139 0.4520567
[36] 0.4553717 0.4586606 0.4619256 0.4651700 0.4683950 0.4716028 0.4747956
[43] 0.4779744 0.4811422 0.4843000 0.4874500 0.4905928 0.4937311 0.4968667
[50] 0.5000000 0.5031333 0.5062689 0.5094072 0.5125500 0.5157000 0.5188578
[57] 0.5220256 0.5252044 0.5283972 0.5316050 0.5348300 0.5380744 0.5413394
[64] 0.5446283 0.5479433 0.5512861 0.5546594 0.5580667 0.5615106 0.5649939
[71] 0.5685206 0.5720939 0.5757183 0.5793978 0.5831378 0.5869428 0.5908194
[78] 0.5947744 0.5988144 0.6029485 0.6071859 0.6115372 0.6160156 0.6206350
[85] 0.6254128 0.6303689 0.6355278 0.6409194 0.6465800 0.6525553 0.6589053
[92] 0.6657080 0.6730700 0.6811444 0.6901567 0.7004750 0.7127539 0.7283756
[99] 0.7513722

simplexreg documentation built on May 1, 2019, 7:12 p.m.