% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/priors.R
\name{prior_weightfunction}
\alias{prior_weightfunction}
\alias{wf_cumulative}
\alias{wf_fixed}
\alias{wf_independent}
\title{Creates a prior distribution for a weight function}
\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")
}
\arguments{
\item{side}{side geometry. Either \code{"one-sided"} or \code{"two-sided"}.}

\item{steps}{increasing p-value cut points between 0 and 1.}

\item{weights}{a weight-prior object created by \code{wf_cumulative()},
\code{wf_fixed()}, or \code{wf_independent()}.}

\item{reference}{reference bin. Currently only \code{"most_significant"} is
supported and fixes the most significant bin to \code{omega = 1}.}

\item{prior_weights}{prior odds associated with a given distribution.}

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

\item{omega}{fixed non-negative relative publication weights, one per bin.
The reference-bin weight must be exactly 1.}

\item{prior}{prior distribution for each non-reference weight.}

\item{scale}{latent scale for independent weights. \code{"omega"} places the
prior directly on the non-negative publication weight. \code{"log_omega"}
places the prior on \code{log(omega)} and transforms with
\code{omega = exp(log_omega)}, allowing weights above one whenever the log
prior assigns mass above zero.}
}
\value{
\code{prior_weightfunction} returns an object of class 'prior'.
}
\description{
\code{prior_weightfunction} creates a prior distribution for
fitting a RoBMA selection model. The \code{side} and \code{steps} arguments
define the p-value bins, and the \code{weights} argument defines the prior on
the publication weights in those bins.
}
\examples{
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)))
)

}
\seealso{
\code{\link[=plot.prior]{plot.prior()}}
}
