check_prior: Check prior parameters

View source: R/check_prior.R

check_priorR Documentation

Check prior parameters

Description

This function checks the compatibility of submitted parameters for the prior distributions and sets missing values to default values.

Usage

check_prior(
  P_f,
  P_r,
  J,
  ordered = FALSE,
  mu_alpha_0 = numeric(P_f),
  Sigma_alpha_0 = 10 * diag(P_f),
  delta = 1,
  mu_b_0 = numeric(P_r),
  Sigma_b_0 = 10 * diag(P_r),
  n_Omega_0 = P_r + 2,
  V_Omega_0 = diag(P_r),
  n_Sigma_0 = J + 1,
  V_Sigma_0 = diag(J - 1),
  mu_d_0 = numeric(J - 2),
  Sigma_d_0 = diag(J - 2)
)

Arguments

P_f

[integer(1)]
The number of covariates connected to a fixed coefficient.

P_r

[integer(2)]
The number of covariates connected to a random coefficient.

J

[integer(1)]
The number >= 2 of choice alternatives.

ordered

[logical(1)]
If TRUE, the choice set alternatives is assumed to be ordered from worst to best.

mu_alpha_0

[numeric(P_f)]
The mean vector of the normal prior for alpha.

Sigma_alpha_0

[matrix(P_f, P_f)]
The covariance matrix of the normal prior for alpha.

delta

[numeric(1)]
The prior concentration for s.

mu_b_0

[numeric(P_r)]
The mean vector of the normal prior for each b_c.

Sigma_b_0

[matrix(P_r, P_r)]
The covariance matrix of the normal prior for each b_c.

n_Omega_0

[integer(1)]
The degrees of freedom of the Inverse Wishart prior for each Omega_c.

V_Omega_0

[matrix(P_r, P_r)]
The scale matrix of the Inverse Wishart prior for each Omega_c.

n_Sigma_0

[integer(1)]
The degrees of freedom of the Inverse Wishart prior for Sigma.

V_Sigma_0

[matrix(J - 1, J - 1)]
The scale matrix of the Inverse Wishart prior for Sigma.

mu_d_0

[numeric(J - 2)]
The mean vector of the normal prior for d .

Sigma_d_0

[matrix(J - 2, J - 2)]
The covariance matrix of the normal prior for d.

Details

A priori-distributions:

  • \alpha \sim N(\mu_{\alpha_0}, \Sigma_{\alpha_0})

  • s \sim Dir(\delta)

  • b_c \sim N(\mu_{b_0}, \Sigma_{b_0}) for all c

  • \Omega_c \sim IW(n_{\Omega_0}, V_{\Omega_0}) for all c

  • \Sigma \sim IW(n_{\Sigma_0}, V_{\Sigma_0})

  • d \sim N(\mu_{d_0}, \Sigma_{d_0})

Value

An object of class RprobitB_prior, which is a list containing all prior parameters.

Examples

check_prior(P_f = 1, P_r = 2, J = 3, ordered = TRUE)

RprobitB documentation built on Aug. 26, 2025, 1:08 a.m.