This function checks the compatibility of submitted parameters for the prior distributions and sets missing values to default values.
Arguments
- 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,
FALSE
per default. IfTRUE
, the choice setalternatives
is assumed to be ordered from worst to best.- eta
The mean vector of length
P_f
of the normal prior foralpha
. Per default,eta = numeric(P_f)
.- Psi
The covariance matrix of dimension
P_f
xP_f
of the normal prior foralpha
. Per default,Psi = diag(P_f)
.- delta
A numeric for the concentration parameter vector
rep(delta,C)
of the Dirichlet prior fors
. Per default,delta = 1
. In case of Dirichlet process-based updates of the latent classes,delta = 0.1
per default.- xi
The mean vector of length
P_r
of the normal prior for eachb_c
. Per default,xi = numeric(P_r)
.- D
The covariance matrix of dimension
P_r
xP_r
of the normal prior for eachb_c
. Per default,D = diag(P_r)
.- nu
The degrees of freedom (a natural number greater than
P_r
) of the Inverse Wishart prior for eachOmega_c
. Per default,nu = P_r + 2
.- Theta
The scale matrix of dimension
P_r
xP_r
of the Inverse Wishart prior for eachOmega_c
. Per default,Theta = diag(P_r)
.- kappa
The degrees of freedom (a natural number greater than
J-1
) of the Inverse Wishart prior forSigma
. Per default,kappa = J + 1
.- E
The scale matrix of dimension
J-1
xJ-1
of the Inverse Wishart prior forSigma
. Per default,E = diag(J - 1)
.- zeta
The mean vector of length
J - 2
of the normal prior for the logarithmic incrementsd
of the utility thresholds in the ordered probit model. Per default,zeta = numeric(J - 2)
.- Z
The covariance matrix of dimension
J-2
xJ-2
of the normal prior for the logarithmic incrementsd
of the utility thresholds in the ordered probit model. Per default,Z = diag(J - 2)
.
Value
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
.
Details
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.
Examples
check_prior(P_f = 1, P_r = 2, J = 3, ordered = TRUE)
#> $eta
#> [1] 0
#>
#> $Psi
#> [,1]
#> [1,] 1
#>
#> $delta
#> [1] 1
#>
#> $xi
#> [1] 0 0
#>
#> $D
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#>
#> $nu
#> [1] 4
#>
#> $Theta
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#>
#> $kappa
#> [1] 4
#>
#> $E
#> [,1]
#> [1,] 1
#>
#> $zeta
#> [1] 0
#>
#> $Z
#> [,1]
#> [1,] 1
#>
#> attr(,"class")
#> [1] "RprobitB_prior" "list"