View source: R/model_fitting.R
check_prior | R Documentation |
This function checks the compatibility of submitted parameters for the prior distributions and sets missing values to default values.
check_prior(
P_f,
P_r,
J,
ordered = FALSE,
eta = numeric(P_f),
Psi = diag(P_f),
delta = 1,
xi = numeric(P_r),
D = diag(P_r),
nu = P_r + 2,
Theta = diag(P_r),
kappa = if (ordered) 4 else (J + 1),
E = if (ordered) diag(1) else diag(J - 1),
zeta = numeric(J - 2),
Z = diag(J - 2)
)
P_f |
The number of covariates connected to a fixed coefficient (can be 0). |
P_r |
The number of covariates connected to a random coefficient (can be 0). |
J |
The number (greater or equal 2) of choice alternatives. |
ordered |
A boolean, |
eta |
The mean vector of length |
Psi |
The covariance matrix of dimension |
delta |
A numeric for the concentration parameter vector |
xi |
The mean vector of length |
D |
The covariance matrix of dimension |
nu |
The degrees of freedom (a natural number greater than |
Theta |
The scale matrix of dimension |
kappa |
The degrees of freedom (a natural number greater than |
E |
The scale matrix of dimension |
zeta |
The mean vector of length |
Z |
The covariance matrix of dimension |
A priori, we assume that the model parameters follow these distributions:
\alpha \sim N(\eta, \Psi)
s \sim Dir(\delta)
b_c \sim N(\xi, D)
for all classes c
\Omega_c \sim IW(\nu,\Theta)
for all classes c
\Sigma \sim IW(\kappa,E)
d \sim N(\zeta, Z)
where N
denotes the normal, Dir
the Dirichlet, and IW
the Inverted Wishart distribution.
An object of class RprobitB_prior
, which is a list containing all
prior parameters. Parameters that are not relevant for the model
configuration are set to NA
.
check_prior(P_f = 1, P_r = 2, J = 3, ordered = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.