% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simplexreg_dist.R
\name{simplex_opt}
\alias{simplex_opt}
\alias{dsimplex}
\alias{psimplex}
\alias{qsimplex}
\alias{rsimplex}
\title{Simplex Distribution Functions}
\usage{
dsimplex(x, mu, sigma2, log = FALSE)

psimplex(q, mu, sigma2, lower.tail = TRUE, log.p = FALSE)

qsimplex(p, mu, sigma2, lower.tail = TRUE, log.p = FALSE)

rsimplex(n, mu, sigma2)
}
\arguments{
\item{x, q}{Numeric vector of quantiles.}

\item{mu}{Mean parameter (\eqn{0 < \mu < 1}).}

\item{sigma2}{Dispersion parameter (\eqn{\sigma^2 > 0}).}

\item{log, log.p}{Logical; if TRUE, probabilities/densities p are given as log(p).}

\item{lower.tail}{Logical; if TRUE (default), probabilities are \eqn{P[X <= x]},
otherwise, \eqn{P[X > x]}.}

\item{p}{Numeric vector of probabilities.}

\item{n}{Number of observations.}
}
\value{
\code{dsimplex} gives the density, \code{psimplex} the
distribution function, \code{qsimplex} the quantile function, and
\code{rsimplex} generates random deviates.

Invalid arguments will result in return value NaN, with a warning.
}
\description{
Density, distribution function, quantile function and random generation for the
simplex distribution with parameters mean \eqn{\mu} and dispersion
\eqn{\sigma^2 > 0}.
}
\details{
The probability density function of the simplex distribution is:
\deqn{f(y; \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2[y(1-y)]^3}}
      \exp\left(-\frac{1}{2\sigma^2} d(y; \mu)\right),}
where \eqn{y \in (0,1)}, and \eqn{d(x; \mu) = \frac{(y - \mu)^2}{y(1 - y)
\mu^2(1 - \mu)^2}}
is the deviance component of the simplex model.
}
\examples{
dsimplex(0.5, mu = 0.3, sigma2 = 0.5)
dsimplex(0.5, mu = 0.3, sigma2 = 0.5, log = TRUE)
psimplex(0.5, mu = 0.3, sigma2 = 0.5)
psimplex(0.5, mu = 0.3, sigma2 = 0.5, lower.tail = FALSE)
qsimplex(0.5, mu = 0.3, sigma2 = 0.5)
qsimplex(log(0.5), mu = 0.3, sigma2 = 0.5, log.p = TRUE)
rsimplex(5, mu = 0.5, sigma2 = 0.5)

}
\references{
Barndorff-Nielsen, O. E. and Jørgensen, B. (1991).
Some parametric models on the simplex.
\emph{Journal of Multivariate Analysis}, \bold{39}(1), 106--116.
\doi{10.1016/0047-259X(91)90008-P}
}
