% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cooks.distance.R
\name{cooks.distance.brma}
\alias{cooks.distance.brma}
\title{Cook's Distance for brma Objects}
\usage{
\method{cooks.distance}{brma}(model, ...)
}
\arguments{
\item{model}{a fitted brma object.}

\item{...}{additional arguments (currently ignored).}
}
\value{
A numeric vector of Cook's distance values, one for each observation.
}
\description{
Computes Cook's distance for a fitted brma object. Cook's
distance measures the aggregate influence of each observation on the
model coefficients.
}
\details{
Cook's distance is computed as a PSIS leave-one-out deletion diagnostic. For
each observation \eqn{i}, normalized PSIS weights estimate the fitted values
under the leave-one-out posterior. The distance is the posterior Mahalanobis
distance between the full-data and leave-one-out fitted-value vectors:
\deqn{D_i = \frac{\Delta_i' V_\mu^+ \Delta_i}{P}}

where \eqn{\Delta_i = \hat{\mu} - \hat{\mu}_{(-i)}}, \eqn{V_\mu^+} is the
generalized inverse of the full-posterior fitted-value covariance, and
\eqn{P} is the rank of the fixed-effect model matrix.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit <- bPET(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
  fit <- add_loo(fit)

  cooks.distance(fit)
}
}

}
\seealso{
\code{\link{influence.brma}}, \code{\link{dffits.brma}}, \code{\link{hatvalues.brma}}
}
