Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simplexUC

Simplex Distribution


Description

Density function, and random generation for the simplex distribution.

Usage

dsimplex(x, mu = 0.5, dispersion = 1, log = FALSE)
rsimplex(n, mu = 0.5, dispersion = 1)

Arguments

x

Vector of quantiles. The support of the distribution is the interval (0,1).

mu, dispersion

Mean and dispersion parameters. The former lies in the interval (0,1) and the latter is positive.

n, log

Same usage as runif.

Details

The VGAM family function simplex fits this model; see that online help for more information. For rsimplex() the rejection method is used; it may be very slow if the density is highly peaked, and will fail if the density asymptotes at the boundary.

Value

dsimplex(x) gives the density function, rsimplex(n) gives n random variates.

Author(s)

T. W. Yee

See Also

Examples

sigma <- c(4, 2, 1)  # Dispersion parameter
mymu  <- c(0.1, 0.5, 0.7); xxx <- seq(0, 1, len = 501)
## Not run:  par(mfrow = c(3, 3))  # Figure 2.1 of Song (2007)
for (iii in 1:3)
  for (jjj in 1:3) {
    plot(xxx, dsimplex(xxx, mymu[jjj], sigma[iii]),
         type = "l", col = "blue", xlab = "", ylab = "", main =
         paste("mu = ", mymu[jjj], ", sigma = ", sigma[iii], sep = "")) } 
## End(Not run)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.