% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/decision.R
\name{htdv_bf}
\alias{htdv_bf}
\title{Bridge-Sampling Bayes Factor}
\usage{
htdv_bf(fit1, fit0, ...)
}
\arguments{
\item{fit1}{Model in the numerator.}

\item{fit0}{Model in the denominator.}

\item{...}{Additional arguments passed to
\code{bridgesampling::bridge_sampler}.}
}
\value{
A list with \code{bf10}, \code{log_bf10}, \code{logml1},
  \code{logml0}, and \code{error_percentage}.
}
\description{
Computes the Bayes factor between two fitted \code{\link{htdv_fit}}
objects via bridge sampling. Requires the \code{bridgesampling} package.
}
\examples{
\donttest{
if (requireNamespace("bridgesampling", quietly = TRUE)) {
  x <- rnorm(50)
  f1 <- htdv_fit(x, model = "tac", chains = 2, iter = 500,
                 refresh = 0, seed = 1)
  f0 <- htdv_fit(x, model = "tac", chains = 2, iter = 500,
                 refresh = 0, seed = 2)
  htdv_bf(f1, f0)$bf10
}
}

}
\references{
Meng, X.-L., & Wong, W.H. (1996). Simulating Ratios of Normalizing
Constants. Statistica Sinica 6(4): 831-860.
Gronau, Q.F. et al. (2017). A Tutorial on Bridge Sampling. JMP 81: 80-97.
}
