From 02d495833a27b5d58f0db13a230cc1b9adab4812 Mon Sep 17 00:00:00 2001 From: Aki Vehtari Date: Fri, 26 Apr 2024 10:54:27 +0300 Subject: [PATCH 1/5] fix equations in loo-glossary --- DESCRIPTION | 2 +- R/loo-glossary.R | 6 +++--- man/loo-glossary.Rd | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf21169e..d7837bc9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -53,5 +53,5 @@ Suggests: VignetteBuilder: knitr Encoding: UTF-8 SystemRequirements: pandoc (>= 1.12.3), pandoc-citeproc -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE) diff --git a/R/loo-glossary.R b/R/loo-glossary.R index 291c8b7e..06ba5ce6 100644 --- a/R/loo-glossary.R +++ b/R/loo-glossary.R @@ -84,15 +84,15 @@ #' is usually negligible. Thinning of MCMC draws can be used to improve #' the ratio ESS/S. #' -#' * If \eqn{k < min(1 - 1 / log10(S), 0.7)}, where \eqn{S} is the +#' * If \eqn{k < \min(1 - 1 / \log_{10}(S), 0.7)}, where \eqn{S} is the #' sample size, the PSIS estimate and the corresponding Monte #' Carlo standard error estimate are reliable. #' -#' * If \eqn{1 - 1 / log10(S) <= k < 0.7}, the PSIS estimate and the +#' * If \eqn{1 - 1 / \log_{10}(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 -#' threshold \eqn{(1 - 1 / log10(2200) > 0.7} and then the bias specific +#' threshold \eqn{(1 - 1 / \log_{10}(2200) > 0.7} and then the bias specific #' threshold 0.7 dominates). #' #' * If \eqn{0.7 <= k < 1}, the PSIS estimate and the corresponding Monte diff --git a/man/loo-glossary.Rd b/man/loo-glossary.Rd index f405fc66..0d135b18 100644 --- a/man/loo-glossary.Rd +++ b/man/loo-glossary.Rd @@ -90,14 +90,14 @@ sample size is less than 2200, but even then if ESS/S > 1/2 the difference is usually negligible. Thinning of MCMC draws can be used to improve the ratio ESS/S. \itemize{ -\item If \eqn{k < min(1 - 1 / log10(S), 0.7)}, where \eqn{S} is the +\item If \eqn{k < \min(1 - 1 / \log_{10}(S), 0.7)}, where \eqn{S} is the sample size, the PSIS estimate and the corresponding Monte Carlo standard error estimate are reliable. -\item If \eqn{1 - 1 / log10(S) <= k < 0.7}, the PSIS estimate and the +\item If \eqn{1 - 1 / \log_{10}(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 -threshold \eqn{(1 - 1 / log10(2200) > 0.7} and then the bias specific +threshold \eqn{(1 - 1 / \log_{10}(2200) > 0.7} and then the bias specific threshold 0.7 dominates). \item If \eqn{0.7 <= k < 1}, the PSIS estimate and the corresponding Monte Carlo standard error have large bias and are not reliable. Increasing From c3c6c00fd599e7e3f6dffaa2f92b9166325d6c19 Mon Sep 17 00:00:00 2001 From: n-kall Date: Mon, 20 May 2024 16:25:38 +0300 Subject: [PATCH 2/5] Fix issue with pareto_khat output no longer being a list --- R/E_loo.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/E_loo.R b/R/E_loo.R index 730bce70..2fef401a 100644 --- a/R/E_loo.R +++ b/R/E_loo.R @@ -291,7 +291,7 @@ E_loo_khat.matrix <- function(x, psis_object, log_ratios, ...) { h_theta <- x_i r_theta <- exp(log_ratios_i - max(log_ratios_i)) khat_r <- posterior::pareto_khat(r_theta, tail = "right", ndraws_tail = tail_len_i) - if (!is.na(khat_r)) { # https://github.com/stan-dev/loo/issues/263 + if (is.list(khat_r)) { # retain compatiblity with older posterior that returned a list khat_r <- khat_r$khat } if (is.null(x_i) || is_constant(x_i) || length(unique(x_i))==2 || @@ -299,7 +299,7 @@ E_loo_khat.matrix <- function(x, psis_object, log_ratios, ...) { khat_r } else { khat_hr <- posterior::pareto_khat(h_theta * r_theta, tail = "both", ndraws_tail = tail_len_i) - if (!is.na(khat_hr)) { # https://github.com/stan-dev/loo/issues/263 + if (is.list(khat_hr)) { # retain compatiblity with older posterior that returned a list khat_hr <- khat_hr$khat } if (is.na(khat_hr) && is.na(khat_r)) { From 1aad6594e6c7f08db11f5a9a96e5088a5880196b Mon Sep 17 00:00:00 2001 From: Aki Vehtari Date: Fri, 14 Jun 2024 10:26:46 +0300 Subject: [PATCH 3/5] =?UTF-8?q?Fix=20name=20Mans=20->=20M=C3=A5ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf21169e..fa7f9f23 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,7 +5,7 @@ Version: 2.7.0.9000 Date: 2024-02-24 Authors@R: c(person("Aki", "Vehtari", email = "Aki.Vehtari@aalto.fi", role = c("aut")), person("Jonah", "Gabry", email = "jsg2201@columbia.edu", role = c("cre", "aut")), - person("Mans", "Magnusson", role = c("aut")), + person("Måns", "Magnusson", role = c("aut")), person("Yuling", "Yao", role = c("aut")), person("Paul-Christian", "Bürkner", role = c("aut")), person("Topi", "Paananen", role = c("aut")), From 23e68bf5fb8aa9d000358f3bbbf52cf7ee92a99c Mon Sep 17 00:00:00 2001 From: jgabry Date: Wed, 3 Jul 2024 09:28:29 -0600 Subject: [PATCH 4/5] prepare for v2.8.0 --- DESCRIPTION | 4 ++-- NEWS.md | 16 +++++++++++++--- man/loo-package.Rd | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index de44af0c..b82ebc01 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: loo Type: Package Title: Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models -Version: 2.7.0.9000 -Date: 2024-02-24 +Version: 2.8.0 +Date: 2024-07-03 Authors@R: c(person("Aki", "Vehtari", email = "Aki.Vehtari@aalto.fi", role = c("aut")), person("Jonah", "Gabry", email = "jsg2201@columbia.edu", role = c("cre", "aut")), person("Måns", "Magnusson", role = c("aut")), diff --git a/NEWS.md b/NEWS.md index 46f8a44e..5a675404 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,16 @@ -# loo 2.7.0.9000 - -Items for next release go here +# loo 2.8.0 + +* make E_loo Pareto-k diagnostic more robust by @avehtari in #251 +* update psis paper reference by @avehtari in #252 +* update PSIS references in vignettes by @jgabry in #254 +* fix loo_moment_match p_loo computation by @avehtari in #257 +* fix loo_moment_matching NaN issue by @avehtari in #259 +* catch Stan log_prob exceptions inside moment matching by @avehtari in #262 +* Fix E_loo_khat error when posterior::pareto_khat returns NA by @jgabry in #264 +* update psis ref + some minor typo fixes by @avehtari in #266 +* update PSIS ref + link to Nabiximols study for Jacobian correction by @avehtari in #267 +* Fix issue with pareto_khat output no longer being a list by @n-kall in #269 +* fix equations in loo-glossary by @avehtari in #268 # loo 2.7.0 diff --git a/man/loo-package.Rd b/man/loo-package.Rd index a65550ba..8888a244 100644 --- a/man/loo-package.Rd +++ b/man/loo-package.Rd @@ -123,7 +123,7 @@ Useful links: Authors: \itemize{ \item Aki Vehtari \email{Aki.Vehtari@aalto.fi} - \item Mans Magnusson + \item Måns Magnusson \item Yuling Yao \item Paul-Christian Bürkner \item Topi Paananen From b1f7a5a6b6444d921a29508460927595a8c49b14 Mon Sep 17 00:00:00 2001 From: jgabry Date: Wed, 3 Jul 2024 14:28:27 -0600 Subject: [PATCH 5/5] bump to dev version after release --- CRAN-SUBMISSION | 6 +++--- DESCRIPTION | 2 +- NEWS.md | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 4a313234..586addcc 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 2.7.0 -Date: 2024-02-24 21:45:11 UTC -SHA: e1f9a29e68f937d992861d40df7e48421204e05b +Version: 2.8.0 +Date: 2024-07-03 16:27:12 UTC +SHA: 23e68bf5fb8aa9d000358f3bbbf52cf7ee92a99c diff --git a/DESCRIPTION b/DESCRIPTION index b82ebc01..02cbf68d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: loo Type: Package Title: Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models -Version: 2.8.0 +Version: 2.8.0.9000 Date: 2024-07-03 Authors@R: c(person("Aki", "Vehtari", email = "Aki.Vehtari@aalto.fi", role = c("aut")), person("Jonah", "Gabry", email = "jsg2201@columbia.edu", role = c("cre", "aut")), diff --git a/NEWS.md b/NEWS.md index 5a675404..f29f26d9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# loo 2.8.0.9000 + +Items for next release go here + # loo 2.8.0 * make E_loo Pareto-k diagnostic more robust by @avehtari in #251