mp_model: Setup multivariate probit model

Description Usage Arguments Details Value Examples

View source: R/estimation.R

Description

Construct a multivariate probit model object that stores information about model structure and parameters

Usage

1
2
3
4
5
6
7
8
9
mp_model(
  model = NULL,
  response = NULL,
  X = NULL,
  formula = NULL,
  data = NULL,
  df = NULL,
  prec_beta = NULL
)

Arguments

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 model.matrix.

data

A data.frame containing the veriables needed by the formula.

df

Degrees of freedom for the normalised Wishart prior for the correlation matrix. See Details.

prec_beta

Prior precision for the regression coefficients

Details

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,Σ). 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(μ,Σ), where μ 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 η of the LKJ prior by the relation df = 2 * eta + d - 1, which makes the two models equivalent.

Value

An object of class mp_model

Examples

1
2
3
4
5
6
## Not run: 
if (interactive()) {
  # EXAMPLE1
}

## End(Not run)

finnlindgren/multiprobit documentation built on June 20, 2020, 6:12 a.m.