make_priors_and_init: Elicit priors and initialization from background dataset

Description Usage Arguments Details Value See Also Examples

View source: R/elicit_priors.R

Description

Here we fix the hyperparameters for priors on theta_i and W_i, i.e., B, U, mu and n_w.

Usage

1
2
3
4
5
6
7
8
make_priors_and_init(
  df.background,
  col.variables,
  col.item,
  use.priors = c("ML", "vague"),
  use.init = c("random", "vague"),
  ...
)

Arguments

df.background

the background dataset

col.variables

columns with variables: names or positions

col.item

column with the id of the item (i): names or positions

use.priors

see details

use.init

see details

...

additional variables for priors and init (see the description)

Details

An appropriate initialization value for W^{-1}_i, i=1,2 ($h_p$ and $h_d$ chains respectively) is also generated.

Notice that we have three chains in the LR computations, the same initialization is used thrice.

Priors

use.priors:

The Wishart dofs nw are set as small as possible without losing full rank: n_w = 2*(p + 1) + 1

Initialization

Generate values for W^{-1}_1, W^{-1}_2 that will be used as starting values for the Gibbs chains. Two methods:

use.init:

Parameters

Some constants can be changed by passing the new values to ... :

Return values

A list of variables:

Value

a list of variables

See Also

Other core functions: bayessource-package, get_minimum_nw_IW(), marginalLikelihood_internal(), marginalLikelihood(), mcmc_postproc(), samesource_C(), two.level.multivariate.calculate.UC()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use the iris data
head(iris, 3)
col_variables <- c(1,3)
col_item <- 5

# Elicitation using MLE
priors_init <- make_priors_and_init(
   df.background = iris,
   col.variables = col_variables,
   col.item = col_item
)

priors_init

priors_init_2 <- make_priors_and_init(
   df.background = iris,
   col.variables = col_variables,
   col.item = col_item,
   use.priors = "vague",
   alpha_init = 100
)

priors_init_2

lgaborini/bayessource documentation built on Nov. 9, 2021, 2:10 p.m.