Raw File
Tip revision: d2eac42f58e4e0f0d07298e8c2e719ef6a30672d authored by Dominique Makowski on 19 June 2020, 08:00 UTC
version 0.7.0
Tip revision: d2eac42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sensitivity_to_prior.R
\title{Sensitivity to Prior}
sensitivity_to_prior(model, index = "Median", magnitude = 10, ...)
\item{model}{A Bayesian model (\code{stanreg} or \code{brmsfit}).}

\item{index}{The indices from which to compute the sensitivity. Can be one or multiple names of the columns returned by \code{describe_posterior}. The case is important here (e.g., write 'Median' instead of 'median').}

\item{magnitude}{This represent the magnitude by which to shift the antagonistic prior (to test the sensitivity). For instance, a magnitude of 10 (default) means that the mode wil be updated with a prior located at 10 standard deviations from its original location.}

\item{...}{Arguments passed to or from other methods.}
Computes the sensitivity to priors specification. This represents the proportion of change in some indices when the model is fitted with an antagonistic prior (a prior of same shape located on the opposite of the effect).

# rstanarm models
# -----------------------------------------------
if (require("rstanarm")) {
  model <- rstanarm::stan_glm(mpg ~ wt, data = mtcars)

  model <- rstanarm::stan_glm(mpg ~ wt + cyl, data = mtcars)
  sensitivity_to_prior(model, index = c("Median", "MAP"))

# brms models
# -----------------------------------------------
if (require("brms")) {
  model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
  # sensitivity_to_prior(model)
back to top