Skip to content

Commit

Permalink
diagnostics.R: a few minor doc edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jgabry committed Feb 7, 2024
1 parent 5f78648 commit 372cb92
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions R/diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#' See **Details** for the motivation behind these defaults.
#'
#' @details
#'
#'
#' The reliability and approximate convergence rate of the PSIS-based
#' estimates can be assessed using the estimates for the shape
#' parameter \eqn{k} of the generalized Pareto distribution. The
#' diagnostic threshold for Pareto \eqn{k} depends on sample size
#' \eqn{S} (sample size dependent threshold was introduced by Vehtari
#' et al., 2022, and before that fixed thresholds of 0.5 and 0.7 were
#' et al. (2022), and before that fixed thresholds of 0.5 and 0.7 were
#' recommended). For simplicity, `loo` package uses the nominal sample
#' size \eqn{S} when computing the sample size specific
#' threshold. This provides an optimistic threshold if the effective
Expand All @@ -35,7 +35,7 @@
#' sample size, the PSIS estimate and the corresponding Monte Carlo
#' standard error estimate are reliable.
#'
#' * If \eqn{1 - 1 / log10(S) <= k < 0.7}, PSIS estimate and the
#' * If \eqn{1 - 1 / log10(S) <= k < 0.7}, the PSIS estimate and the
#' corresponding Monte Carlo standard error estimate are not
#' reliable, but increasing the (effective) sample size \eqn{S} above
#' 2200 may help (this will increase the sample size specific
Expand All @@ -44,19 +44,19 @@
#'
#' * If \eqn{0.7 <= k < 1}, the PSIS estimate and the corresponding Monte
#' Carlo standard error have large bias and are not reliable. Increasing
#' the sample size may reduce the uncertainty in the \eqn{k} estimate.
#' the sample size may reduce the uncertainty in the \eqn{k} estimate.
#'
#' * If \eqn{0.7 <= k < 1}, PSIS estimate and the corresponding Monte
#' * If \eqn{0.7 <= k < 1}, the PSIS estimate and the corresponding Monte
#' Carlo standard error have large bias and are not reliable. Increasing
#' sample size may reduce the variability in \eqn{k} estimate, which
#' the sample size may reduce the variability in \eqn{k} estimate, which
#' may result in lower \eqn{k} estimate, too.
#'
#' * If \eqn{k \geq 1}{k >= 1}, the target distribution is estimated to
#' have non-finite mean. The PSIS estimate and the corresponding Monte
#' have a non-finite mean. The PSIS estimate and the corresponding Monte
#' Carlo standard error are not well defined. Increasing the sample size
#' may reduce the variability in \eqn{k} estimate, which
#' may result in lower \eqn{k} estimate, too.
#'
#' may reduce the variability in the \eqn{k} estimate, which
#' may also result in a lower \eqn{k} estimate.
#'
#' \subsection{What if the estimated tail shape parameter \eqn{k}
#' exceeds the diagnostic threshold?}{ Importance sampling is likely to
#' work less well if the marginal posterior \eqn{p(\theta^s | y)} and
Expand All @@ -67,7 +67,7 @@
#' warned. (Note: If \eqn{k} is greater than the diagnostic threshold
#' then WAIC is also likely to fail, but WAIC lacks as accurate
#' diagnostic.) When using PSIS in the context of approximate LOO-CV,
#' we recommend one of the following actions when \eqn{k > 0.7}:
#' we recommend one of the following actions:
#'
#' * With some additional computations, it is possible to transform
#' the MCMC draws from the posterior distribution to obtain more
Expand Down Expand Up @@ -101,8 +101,8 @@
#' sample size for importance sampling, which are more accurate for PSIS than
#' for IS and TIS (see Vehtari et al (2022) for details). However, the PSIS
#' effective sample size estimate will be
#' **over-optimistic when the estimate of \eqn{k} is greater than
#' \eqn{min(1-1/log10(S), 0.7)}**, where \eqn{S} is the sample size.
#' **over-optimistic when the estimate of \eqn{k} is greater than**
#' \eqn{min(1-1/log10(S), 0.7)}, where \eqn{S} is the sample size.
#' }
#'
#' @seealso
Expand Down
20 changes: 10 additions & 10 deletions man/pareto-k-diagnostic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 372cb92

Please sign in to comment.