Learn R Programming

BayesTools (version 0.3.0)

prior_weightfunction: Creates a prior distribution for a weight function

Description

prior_weightfunction creates a prior distribution for fitting a RoBMA selection model. The side and steps arguments define the p-value bins, and the weights argument defines the prior on the publication weights in those bins.

Usage

prior_weightfunction(
  side = "one-sided",
  steps = c(0.025, 0.05),
  weights = wf_cumulative(),
  reference = "most_significant",
  prior_weights = 1
)

wf_cumulative(alpha = NULL)

wf_fixed(omega)

wf_independent(prior, scale = "omega")

Value

prior_weightfunction returns an object of class 'prior'.

Arguments

side

side geometry. Either "one-sided" or "two-sided".

steps

increasing p-value cut points between 0 and 1.

weights

a weight-prior object created by wf_cumulative(), wf_fixed(), or wf_independent().

reference

reference bin. Currently only "most_significant" is supported and fixes the most significant bin to omega = 1.

prior_weights

prior odds associated with a given distribution.

alpha

positive cumulative-Dirichlet concentration parameters. If omitted, a flat Dirichlet prior is used with one concentration parameter per bin.

omega

fixed non-negative relative publication weights, one per bin. The reference-bin weight must be exactly 1.

prior

prior distribution for each non-reference weight.

scale

latent scale for independent weights. "omega" places the prior directly on the non-negative publication weight. "log_omega" places the prior on log(omega) and transforms with omega = exp(log_omega), allowing weights above one whenever the log prior assigns mass above zero.

See Also

plot.prior()

Examples

Run this code
p1 <- prior_weightfunction(
  side = "one-sided",
  steps = c(.05, .10),
  weights = wf_cumulative(alpha = c(1, 1, 1))
)

p2 <- prior_weightfunction(
  side = "one-sided",
  steps = c(.05),
  weights = wf_independent(prior("beta", list(1, 1)))
)

Run the code above in your browser using DataLab