Skip to content

Commit

Permalink
Merge pull request #344 from stan-dev/update-psis-paper-reference
Browse files Browse the repository at this point in the history
update psis paper reference
  • Loading branch information
paul-buerkner authored Mar 1, 2024
2 parents c312846 + e168016 commit 206f2cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R/gpd.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ qgeneralized_pareto <- function(p, mu = 0, sigma = 1, k = 0, lower.tail = TRUE,
#' 0. By default the fit uses a prior for \eqn{k} (this is in addition to the prior described by Zhang and Stephens, 2009), which will stabilize
#' estimates for very small sample sizes (and low effective sample sizes in the
#' case of MCMC samples). The weakly informative prior is a Gaussian prior
#' centered at 0.5 (see details in Vehtari et al., 2022).
#' centered at 0.5 (see details in Vehtari et al., 2024).
#'
#' @param x A numeric vector. The sample from which to estimate the parameters.
#' @param wip Logical indicating whether to adjust \eqn{k} based on a weakly
Expand Down Expand Up @@ -67,7 +67,7 @@ gpdfit <- function(x, wip = TRUE, min_grid_pts = 30, sort_x = TRUE) {
sigma_hat <- -k_hat / theta_hat

# adjust k_hat based on weakly informative prior, Gaussian centered on 0.5.
# this stabilizes estimates for very small Monte Carlo sample sizes and low neff (see Vehtari et al., 2022 for details)
# this stabilizes estimates for very small Monte Carlo sample sizes and low neff (see Vehtari et al., 2024 for details)
if (wip) {
k_hat <- (k_hat * N + 0.5 * 10) / (N + 10)
}
Expand Down
10 changes: 5 additions & 5 deletions R/pareto_smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Estimate Pareto k value by fitting a Generalized Pareto
#' Distribution to one or two tails of x. This can be used to estimate
#' the number of fractional moments that is useful for convergence
#' diagnostics. For further details see Vehtari et al. (2022).
#' diagnostics. For further details see Vehtari et al. (2024).
#'
#' @family diagnostics
#' @template args-pareto
Expand Down Expand Up @@ -91,21 +91,21 @@ pareto_khat.rvar <- function(x, ...) {
#' Pareto smoothed estimates can be considered reliable. If the actual
#' sample size is lower than `min_ss`, increasing the sample size
#' might result in more reliable estimates. For further details, see
#' Section 3.2.3, Equation 11 in Vehtari et al. (2022).
#' Section 3.2.3, Equation 11 in Vehtari et al. (2024).
#'
#' * `khat_threshold`: Threshold below which k-hat values result in
#' reliable Pareto smoothed estimates. The threshold is lower for
#' smaller effective sample sizes. If k-hat is larger than the
#' threshold, increasing the total sample size may improve reliability
#' of estimates. For further details, see Section 3.2.4, Equation 13
#' in Vehtari et al. (2022).
#' in Vehtari et al. (2024).
#'
#' * `convergence_rate`: Relative convergence rate compared to the
#' central limit theorem. Applicable only if the actual sample size
#' is sufficiently large (greater than `min_ss`). The convergence
#' rate tells the rate at which the variance of an estimate reduces
#' when the sample size is increased, compared to the central limit
#' theorem convergence rate. See Appendix B in Vehtari et al. (2022).
#' theorem convergence rate. See Appendix B in Vehtari et al. (2024).
#'
#' @seealso [`pareto_khat`] for only calculating khat, and
#' [`pareto_smooth`] for Pareto smoothed draws.
Expand Down Expand Up @@ -177,7 +177,7 @@ pareto_diags.rvar <- function(x, ...) {
#'
#' Smooth the tail draws of x by replacing tail draws by order
#' statistics of a generalized Pareto distribution fit to the
#' tail(s). For further details see Vehtari et al. (2022).
#' tail(s). For further details see Vehtari et al. (2024).
#'
#' @template args-pareto
#' @param return_k (logical) Should the Pareto khat be included in
Expand Down
2 changes: 1 addition & 1 deletion man-roxygen/args-pareto.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' `ndraws_tail` is not specified, it will be calculated as
#' ceiling(3 * sqrt(length(x) / r_eff)) if length(x) > 225 and
#' length(x) / 5 otherwise (see Appendix H in Vehtari et
#' al. (2022)).
#' al. (2024)).
#' @param r_eff (numeric) relative effective sample size estimate. If
#' `r_eff` is NULL, it will be calculated assuming the draws are
#' from MCMC. Default is 1.
Expand Down
3 changes: 2 additions & 1 deletion man-roxygen/ref-vehtari-paretosmooth-2022.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @references
#' Aki Vehtari, Daniel Simpson, Andrew Gelman, Yuling Yao and
#' Jonah Gabry (2022). Pareto Smoothed Importance Sampling.
#' Jonah Gabry (2024). Pareto Smoothed Importance Sampling.
#' *Journal of Machine Learning Research*, accepted for publication.
#' arxiv:arXiv:1507.02646 (version 8)

0 comments on commit 206f2cc

Please sign in to comment.