Skip to content

Commit

Permalink
Apply suggestions from Noa's scode review
Browse files Browse the repository at this point in the history
Co-authored-by: n-kall <[email protected]>
  • Loading branch information
avehtari and n-kall authored Jan 24, 2024
1 parent 26e8a7b commit 5abf6e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions R/diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
#' generalized Pareto distribution:
#'
#' * If \eqn{k < min(1 - 1 / log10(S), 0.7)}, where \eqn{S} is the
#' sample size PSIS estimate and the corresponding Monte Carlo
#' sample size, 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}, PSIS estimate and the
#' corresponding Monte Carlo standard error estimate are not reliable,
#' but increasing (effective) sample size \eqn{S} above 2200 may help.
#'
#' * If \eqn{0.7 <= k < 1} PSIS estimate and the corresponding Monte
#' * If \eqn{0.7 <= k < 1}, PSIS estimate and the corresponding Monte
#' Carlo standard error have large bias and are not reliable. Increasing
#' sample size may reduce the uncertainty in \eqn{k} estimate.
#'
#' * If \eqn{k \geq 1}{k >= 1} The target distribution is estimated to
#' * If \eqn{k \geq 1}{k >= 1}, the target distribution is estimated to
#' have non-finite mean. PSIS estimate and the corresponding Monte
#' Carlo standard error are not well defined. Increasing sample size
#' may reduce the uncertainty in \eqn{k} estimate.
Expand All @@ -45,7 +45,7 @@
#' nominal sample size (e.g. if MCMC-ESS > S/4).
#'
#' \subsection{What if the estimated tail shape parameter \eqn{k}
#' exceeds diagnostic threshold}{ Importance sampling is likely to
#' exceeds the diagnostic threshold?}{ Importance sampling is likely to
#' work less well if the marginal posterior \eqn{p(\theta^s | y)} and
#' LOO posterior \eqn{p(\theta^s | y_{-i})} are very different, which
#' is more likely to happen with a non-robust model and highly
Expand Down Expand Up @@ -234,7 +234,7 @@ mcse_loo <- function(x, threshold = NULL) {
#' @export
#' @param label_points,... For the `plot()` method, if `label_points` is
#' `TRUE` the observation numbers corresponding to any values of \eqn{k}
#' greater than the diagnostic threhold will be displayed in the plot.
#' greater than the diagnostic threshold will be displayed in the plot.
#' Any arguments specified in `...` will be passed to [graphics::text()]
#' and can be used to control the appearance of the labels.
#' @param diagnostic For the `plot` method, which diagnostic should be
Expand Down
8 changes: 4 additions & 4 deletions R/loo-glossary.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#' importance sampling and guarantees finite variance estimate with a
#' cost of some bias.
#'
#' The diagnostic threshold for Pareto k depends on sample size
#' The diagnostic threshold for Pareto \eqn{k} depends on sample size
#' \eqn{S}. For simplicity the nominal sample size \eqn{S} is used
#' when computing the sample size specific threshold. This is likely
#' to provide optimistic threshold, but for many purposes this is fine
Expand All @@ -83,15 +83,15 @@
#' sample size 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}, PSIS estimate and the
#' corresponding Monte Carlo standard error estimate are not reliable,
#' but increasing (effective) sample size \eqn{S} above 2200 may help.
#'
#' * If \eqn{0.7 <= k < 1} PSIS estimate and the corresponding Monte
#' * If \eqn{0.7 <= k < 1}, PSIS estimate and the corresponding Monte
#' Carlo standard error have large bias and are not reliable. Increasing
#' sample size may reduce the uncertainty in \eqn{k} estimate.
#'
#' * If \eqn{k \geq 1}{k >= 1} The target distribution is estimated to
#' * If \eqn{k \geq 1}{k >= 1}, the target distribution is estimated to
#' have non-finite mean. PSIS estimate and the corresponding Monte
#' Carlo standard error are not well defined. Increasing sample size
#' may reduce the uncertainty in \eqn{k} estimate.
Expand Down

0 comments on commit 5abf6e6

Please sign in to comment.