mp_model | R Documentation |
Construct a multivariate probit model object that stores information about model structure and parameters
mp_model(
model = NULL,
response = NULL,
X = NULL,
formula = NULL,
data = NULL,
df = NULL,
prec_beta = NULL
)
model |
An optional existing model object to be updated. |
response |
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. |
X |
An optimally precomputed n-by-J model matrix, where J is the number regression coeficcients for each of the d dimensions. |
formula |
A formula interpretable by |
data |
A |
df |
Degrees of freedom for the normalised Wishart prior for the correlation matrix. See Details. |
prec_beta |
Prior precision for the regression coefficients |
The multivariate probit model has a multivariate binary
response variable, here denoted Y
. The model is built from a
linear predictor
M = X B
where X
is a n-by-J matrix of J
predictors, and B
is
a J-by-d matrix of regression coefficients.
Each row of M
is the linear
predictor for one multivariate observation. The response variables Y
are linked to M
by first defining latent Gaussian variables
Z=M+E
where each row of E
is a multivariate Normal vector,
E \sim N(0,\Sigma)
. Then,
Y_{i,k}=I(Z_{i,k} > 0).
Conditionally on B
, each row of Y
has a multinomial distribution
on the set of all 0/1
combinations, with each probability equal to a
hyperquadrant probability of a the multivariate Normal distribution
N(\mu,\Sigma)
, where \mu
is the corresponding row of M
.
Only the inequality Y_{i,k} > 0
for the response variables is used,
so alternative data representations such as -1/+1
will also work as
expected.
The degrees of freedom for the normalised Wishart prior are linked to the
concentration pararameter \eta
of the LKJ prior by the relation
df = 2 * eta + d - 1
, which makes the two models equivalent.
An object of class mp_model
## Not run:
if (interactive()) {
# EXAMPLE1
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.