View source: R/probabilities.R
mpp | R Documentation |
Evaluate one or more probabilities for outcomes of a multivariate probit model, with given location and covariance scale parameteters.
mpp(
y,
mu,
Sigma_chol = NULL,
Q_chol = NULL,
log = FALSE,
lower_chol = FALSE,
gaussint_options = NULL,
...
)
y |
A matrix with n-by-d elements, where each row is a multivariate observation, see Details. A vector is interpreted as a single row matrix. |
mu |
A matrix with n-by-d elements, where each row is an expectation vector parameter, see Details. A vector is interpreted as a single row matrix. |
Sigma_chol |
The Cholesky factor of the covariance matrix parameter, Default: NULL |
Q_chol |
The Cholesky factor of the precision matrix matrix parameter, Default: NULL |
log |
logical indicating if the log-probability should be returned, Default: FALSE |
lower_chol |
|
gaussint_options |
list of options for |
... |
Further parameters, currently ignored |
Computes the probability
P(y_1 > 0, ..., y_d > 0|\mu,\Sigma)
when y
is a d
-dimensional indicator vector with elements
y_i=I(z_i > 0)
, and z
is a d
-dimensional
Gaussian vector with distribution N(\mu,\Sigma)
. Only the inequality
for y_i
is used, so alternative data representations such as
-1/+1
will also work as expected.
The \Sigma
paramter can either be specified though its Cholesky factor
Sigma_chol
or through the Cholesky factor of the precision (inverse
of \Sigma
) Q_chol
.
The logical parameter lower_chol
determines if a lower or upper
triangular Cholesky factor was supplied.
The internal seed
parameter for excursions::gaussint
can be
provided as an element of gaussint_options
, which provides
consistent approximation error when calculating numerical derivatives.
A list with components
A vector of probabilities
A vector with the estimated approximation error for each probability
if (interactive()) {
mpp(
y = c(1, 0),
mu = c(1, 2),
Sigma_chol = chol(matrix(c(1, 0.5, 0.5, 1), 2, 2))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.