\HeaderA{qmvnorm}{Quantiles of the Multvariate Normal Distribution}{qmvnorm}
\keyword{distribution}{qmvnorm}
\begin{Description}\relax
Computes the equicoordinate quantile function of the multivariate normal
distribution for arbitrary correlation matrices
based on an inversion of the algorithms by Genz and Bretz.
\end{Description}
\begin{Usage}
\begin{verbatim}
qmvnorm(p, interval = c(-10, 10), tail = c("lower.tail", "upper.tail", "both.tails"), 
        mean = 0, corr = NULL, sigma = NULL, maxpts = 25000, abseps = 0.001, 
        releps = 0, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{p}] probability.
\item[\code{interval}] a vector containing the end-points of the interval to be
searched by \code{\LinkA{uniroot}{uniroot}}.
\item[\code{tail}] specifies which quantiles should be computed.
\code{lower.tail} gives the quantile \eqn{x}{} for which 
\eqn{P[X \le x] = p}{}, \code{upper.tail} gives \eqn{x}{} with 
\eqn{P[X > x] = p}{} and 
\code{both.tails} leads to \eqn{x}{} 
with \eqn{P[-x \le X \le x] = p}{}.
\item[\code{mean}] the mean vector of length n. 
\item[\code{corr}] the correlation matrix of dimension n.
\item[\code{sigma}] the covariance matrix of dimension n. Either \code{corr} or
\code{sigma} can be specified. If \code{sigma} is given, the
problem is standardized. If neither \code{corr} nor
\code{sigma} is given, the identity matrix is used
for \code{sigma}. 
\item[\code{maxpts}] maximum number of function values as integer. 
\item[\code{abseps}] absolute integration error tolerance as double. 
\item[\code{releps}] relative integration error tolerance as double. 
\item[\code{...}] additional paramters to be passed to
\code{\LinkA{uniroot}{uniroot}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Only equicoordinate quantiles are computed, i.e., the quantiles in each
dimension coincide. Currently, the distribution function is inverted by 
using the
\code{\LinkA{uniroot}{uniroot}} function which may result in limited accuracy of the 
quantiles.
\end{Details}
\begin{Value}
A list with four components: \code{quantile} and \code{f.quantile} 
give the location of the quantile and the value of the function
evaluated at that point. \code{iter} and \code{estim.prec} give the number 
of iterations used and an approximate estimated precision from
\code{\LinkA{uniroot}{uniroot}}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{pmvnorm}{pmvnorm}}, \code{\LinkA{qmvt}{qmvt}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
qmvnorm(0.95, sigma = diag(2), tail = "both")
\end{ExampleCode}
\end{Examples}

