From 040775e7e545df12c16c234149709498f084da4c Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Mon, 25 Mar 2024 17:47:20 +0000 Subject: [PATCH 01/11] Add report.compare.loo --- DESCRIPTION | 1 + NAMESPACE | 1 + R/report.compare.loo.R | 59 +++++++++++++++++++++++++++++++++++++++ man/report.compare.loo.Rd | 39 ++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 R/report.compare.loo.R create mode 100644 man/report.compare.loo.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 35d6c831..a38edffe 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -107,6 +107,7 @@ Collate: 'report.stanreg.R' 'report.brmsfit.R' 'report.character.R' + 'report.compare.loo.R' 'report.compare_performance.R' 'report.data.frame.R' 'report.default.R' diff --git a/NAMESPACE b/NAMESPACE index a3cb2ff5..16c56e96 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -36,6 +36,7 @@ S3method(report,bayesfactor_inclusion) S3method(report,bayesfactor_models) S3method(report,brmsfit) S3method(report,character) +S3method(report,compare.loo) S3method(report,compare_performance) S3method(report,data.frame) S3method(report,default) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R new file mode 100644 index 00000000..fc9d8f70 --- /dev/null +++ b/R/report.compare.loo.R @@ -0,0 +1,59 @@ +#' Reporting Bayesian Model Comparison +#' +#' Automatically report the results of Bayesian model comparison using the `loo` package. +#' +#' @param x An object of class [loo_compare()]. +#' +#' @examplesIf require("brms", quietly = TRUE) +#' \donttest{ +#' library(brms) +#' +#' m1 <- brms::brm(mpg ~ qsec, data=mtcars) +#' m2 <- brms::brm(mpg ~ qsec + drat, data=mtcars) +#' +#' x <- brms::loo_compare(brms::add_criterion(m1, "loo"), +#' brms::add_criterion(m2, "loo"), +#' model_names=c("m1", "m2")) +#' report(x) +#' } +#' +#' @details +#' The rule of thumb is that the models are "very similar" if |elpd_diff| (the +#' absolute value of elpd_diff) is less than 4 (Sivula, Magnusson and Vehtari, 2020). +#' If superior to 4, then one can use the SE to obtain a standardized difference +#' (Z-diff) and interpret it as such, assuming that the difference is normally +#' distributed. +#' +#' @return Objects of class [report_text()]. +#' @export +report.compare.loo <- function(x, ...) { + # https://stats.stackexchange.com/questions/608881/how-to-interpret-elpd-diff-of-bayesian-loo-estimate-in-bayesian-logistic-regress + # https://users.aalto.fi/%7Eave/CV-FAQ.html#12_What_is_the_interpretation_of_ELPD__elpd_loo__elpd_diff + # https://users.aalto.fi/%7Eave/CV-FAQ.html#se_diff + + # The difference in expected log predictive density (elpd) between each model + # and the best model as well as the standard error of this difference (assuming + # the difference is approximately normal). + x <- as.data.frame(x) + # The values in the first row are 0s because the models are ordered from best to worst according to their elpd. + modnames <- rownames(x) + + # + z_elpd_diff <- x$elpd_diff / x$se_diff + + text <- "The difference in predictive accuracy, as index by Expected Log Predictive Density (ELPD), suggests that '" + text <- paste0(text, modnames[1], "' is the best model, followed by '") + + for (m in 2:(nrow(x))) { + text <- paste0(text, modnames[m ], + "' (diff = ", + insight::format_value(x$elpd_diff[m]), + # " ± ", + # insight::format_value(x$se_diff[m]), + ", Z-diff = ", + insight::format_value(z_elpd_diff[m]), + ")") + } + class(text) <- c("report_text", class(text)) + text +} \ No newline at end of file diff --git a/man/report.compare.loo.Rd b/man/report.compare.loo.Rd new file mode 100644 index 00000000..e03ef453 --- /dev/null +++ b/man/report.compare.loo.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/report.compare.loo.R +\name{report.compare.loo} +\alias{report.compare.loo} +\title{Reporting Bayesian Model Comparison} +\usage{ +\method{report}{compare.loo}(x) +} +\arguments{ +\item{x}{An object of class \code{\link[=loo_compare]{loo_compare()}}.} +} +\value{ +Objects of class \code{\link[=report_text]{report_text()}}. +} +\description{ +Automatically report the results of Bayesian model comparison using the \code{loo} package. +} +\details{ +The rule of thumb is that the models are "very similar" if |elpd_diff| (the +absolute value of elpd_diff) is less than 4 (Sivula, Magnusson and Vehtari, 2020). +If superior to 4, then one can use the SE to obtain a standardized difference +(Z-diff) and interpret it as such, assuming that the difference is normally +distributed. +} +\examples{ +\dontshow{if (require("brms", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\donttest{ +library(brms) + +m1 <- brms::brm(mpg ~ qsec, data=mtcars) +m2 <- brms::brm(mpg ~ qsec + wt, data=mtcars) + +x <- brms::loo_compare(brms::add_criterion(m1, "loo"), + brms::add_criterion(m2, "loo"), + model_names=c("m1", "m2")) +report(x) +} +\dontshow{\}) # examplesIf} +} From c4fc84df232f676cb6ab1c523b5e092900d2cedc Mon Sep 17 00:00:00 2001 From: "Mattan S. Ben-Shachar" Date: Tue, 26 Mar 2024 09:49:22 +0200 Subject: [PATCH 02/11] more option for loo-comapre --- R/report.compare.loo.R | 73 ++++++++++++++++++++++++++++++--------- man/report.compare.loo.Rd | 7 ++-- 2 files changed, 62 insertions(+), 18 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index fc9d8f70..e9f5d6dc 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -3,6 +3,8 @@ #' Automatically report the results of Bayesian model comparison using the `loo` package. #' #' @param x An object of class [loo_compare()]. +#' @param index type if index to report - expected log pointwise predictive +#' density (ELPD) or information criteria (IC). #' #' @examplesIf require("brms", quietly = TRUE) #' \donttest{ @@ -26,7 +28,7 @@ #' #' @return Objects of class [report_text()]. #' @export -report.compare.loo <- function(x, ...) { +report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { # https://stats.stackexchange.com/questions/608881/how-to-interpret-elpd-diff-of-bayesian-loo-estimate-in-bayesian-logistic-regress # https://users.aalto.fi/%7Eave/CV-FAQ.html#12_What_is_the_interpretation_of_ELPD__elpd_loo__elpd_diff # https://users.aalto.fi/%7Eave/CV-FAQ.html#se_diff @@ -34,26 +36,65 @@ report.compare.loo <- function(x, ...) { # The difference in expected log predictive density (elpd) between each model # and the best model as well as the standard error of this difference (assuming # the difference is approximately normal). + index <- match.arg(index) x <- as.data.frame(x) # The values in the first row are 0s because the models are ordered from best to worst according to their elpd. modnames <- rownames(x) - # - z_elpd_diff <- x$elpd_diff / x$se_diff - - text <- "The difference in predictive accuracy, as index by Expected Log Predictive Density (ELPD), suggests that '" - text <- paste0(text, modnames[1], "' is the best model, followed by '") - - for (m in 2:(nrow(x))) { - text <- paste0(text, modnames[m ], - "' (diff = ", - insight::format_value(x$elpd_diff[m]), - # " ± ", - # insight::format_value(x$se_diff[m]), - ", Z-diff = ", - insight::format_value(z_elpd_diff[m]), - ")") + elpd_diff <- x[["elpd_diff"]] + ic_diff <- -2 * elpd_diff + + z_elpd_diff <- elpd_diff / x[["se_diff"]] + z_ic_diff <- -z_elpd_diff + + if ("looic" %in% colnames(x)) { + type <- "LOO" + ENP <- x[["p_loo"]] + } else { + type <- "WAIC" + ENP <- x[["p_waic"]] + } + + if (index == "ELPD") { + index_label <- sprintf("Expected Log Predictive Density (ELPD-%s)", type) + } else { + if (type == "LOO") { + index_label <- "Leave-One-Out CV Information Criterion (LOOIC)" + } else { + index_label <- "Widely Applicable Information Criterion (WAIC)" + } } + + text <- sprintf("The difference in predictive accuracy, as index by %s, suggests that '%s' is the best model (effective number of parameters (ENP) = %.2f), followed by", + index_label, modnames[1], ENP[1]) + + if (index == "ELPD") { + other_texts <- sprintf("'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", + modnames[-1], + elpd_diff[-1], + ENP[-1], + z_elpd_diff[-1]) + } else { + other_texts <- sprintf("'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", + modnames[-1], + ic_diff[-1], + ENP[-1], + z_ic_diff[-1]) + } + + sep <- "." + nothermods <- length(other_texts) + if (nothermods > 1L) { + if (nothermods == 2L) { + sep <- c(" and ", sep) + } else { + sep <- c(rep(", ", length = nothermods - 2), ", and ", sep) + } + } + + other_texts <- paste0(other_texts, sep, collapse = "") + + text <- paste(text, other_texts, collapse = "") class(text) <- c("report_text", class(text)) text } \ No newline at end of file diff --git a/man/report.compare.loo.Rd b/man/report.compare.loo.Rd index e03ef453..f420ab50 100644 --- a/man/report.compare.loo.Rd +++ b/man/report.compare.loo.Rd @@ -4,10 +4,13 @@ \alias{report.compare.loo} \title{Reporting Bayesian Model Comparison} \usage{ -\method{report}{compare.loo}(x) +\method{report}{compare.loo}(x, index = c("ELPD", "IC"), ...) } \arguments{ \item{x}{An object of class \code{\link[=loo_compare]{loo_compare()}}.} + +\item{index}{type if index to report - expected log pointwise predictive +density (ELPD) or information criteria (IC).} } \value{ Objects of class \code{\link[=report_text]{report_text()}}. @@ -28,7 +31,7 @@ distributed. library(brms) m1 <- brms::brm(mpg ~ qsec, data=mtcars) -m2 <- brms::brm(mpg ~ qsec + wt, data=mtcars) +m2 <- brms::brm(mpg ~ qsec + drat, data=mtcars) x <- brms::loo_compare(brms::add_criterion(m1, "loo"), brms::add_criterion(m2, "loo"), From 224ce962273c7627630ee6e8c452459299ac225c Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Thu, 28 Mar 2024 13:37:13 +0000 Subject: [PATCH 03/11] fixes --- R/report.compare.loo.R | 3 ++- man/report.compare.loo.Rd | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index e9f5d6dc..6d8a9a29 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -2,9 +2,10 @@ #' #' Automatically report the results of Bayesian model comparison using the `loo` package. #' -#' @param x An object of class [loo_compare()]. +#' @param x An object of class [brms::loo_compare]. #' @param index type if index to report - expected log pointwise predictive #' density (ELPD) or information criteria (IC). +#' @param ... Additional arguments (not used for now). #' #' @examplesIf require("brms", quietly = TRUE) #' \donttest{ diff --git a/man/report.compare.loo.Rd b/man/report.compare.loo.Rd index f420ab50..b95c4af1 100644 --- a/man/report.compare.loo.Rd +++ b/man/report.compare.loo.Rd @@ -7,10 +7,12 @@ \method{report}{compare.loo}(x, index = c("ELPD", "IC"), ...) } \arguments{ -\item{x}{An object of class \code{\link[=loo_compare]{loo_compare()}}.} +\item{x}{An object of class \link[brms:loo_compare.brmsfit]{brms::loo_compare}.} \item{index}{type if index to report - expected log pointwise predictive density (ELPD) or information criteria (IC).} + +\item{...}{Additional arguments (not used for now).} } \value{ Objects of class \code{\link[=report_text]{report_text()}}. From 35bb08c3e80b2051b404572c52d213cf21e5d61c Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Fri, 29 Mar 2024 09:42:41 +0000 Subject: [PATCH 04/11] Update WORDLIST --- inst/WORDLIST | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inst/WORDLIST b/inst/WORDLIST index 055ef665..af7640ca 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -4,9 +4,12 @@ BibLaTeX CMD CSL Dom +ELPD ESS Gabry Hotfix +IC +Magnusson Mattan Newcombe ORCID @@ -16,16 +19,20 @@ Rhat SEM SEXIT Shachar +Sivula +Vehtari amongst anova bmwiernik brms eXistence easystats +elpd github htest https ivreg +lifecycle mattansb pacakges participants’ @@ -42,4 +49,3 @@ unarchive versicolor virginica ’s -lifecycle From 038975b5f35bead2f2469716b7bfc6e0afff6e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:44:44 +0100 Subject: [PATCH 05/11] fix build_reference_index, styler --- R/report.compare.loo.R | 41 ++++++++++++++++++++++++----------------- _pkgdown.yml | 1 + 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index 6d8a9a29..9a39cd04 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -11,12 +11,13 @@ #' \donttest{ #' library(brms) #' -#' m1 <- brms::brm(mpg ~ qsec, data=mtcars) -#' m2 <- brms::brm(mpg ~ qsec + drat, data=mtcars) +#' m1 <- brms::brm(mpg ~ qsec, data = mtcars) +#' m2 <- brms::brm(mpg ~ qsec + drat, data = mtcars) #' #' x <- brms::loo_compare(brms::add_criterion(m1, "loo"), -#' brms::add_criterion(m2, "loo"), -#' model_names=c("m1", "m2")) +#' brms::add_criterion(m2, "loo"), +#' model_names = c("m1", "m2") +#' ) #' report(x) #' } #' @@ -66,21 +67,27 @@ report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { } } - text <- sprintf("The difference in predictive accuracy, as index by %s, suggests that '%s' is the best model (effective number of parameters (ENP) = %.2f), followed by", - index_label, modnames[1], ENP[1]) + text <- sprintf( + "The difference in predictive accuracy, as index by %s, suggests that '%s' is the best model (effective number of parameters (ENP) = %.2f), followed by", + index_label, modnames[1], ENP[1] + ) if (index == "ELPD") { - other_texts <- sprintf("'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", - modnames[-1], - elpd_diff[-1], - ENP[-1], - z_elpd_diff[-1]) + other_texts <- sprintf( + "'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", + modnames[-1], + elpd_diff[-1], + ENP[-1], + z_elpd_diff[-1] + ) } else { - other_texts <- sprintf("'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", - modnames[-1], - ic_diff[-1], - ENP[-1], - z_ic_diff[-1]) + other_texts <- sprintf( + "'%s' (diff = %.2f, ENP = %.2f, z-diff = %.2f)", + modnames[-1], + ic_diff[-1], + ENP[-1], + z_ic_diff[-1] + ) } sep <- "." @@ -98,4 +105,4 @@ report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { text <- paste(text, other_texts, collapse = "") class(text) <- c("report_text", class(text)) text -} \ No newline at end of file +} diff --git a/_pkgdown.yml b/_pkgdown.yml index e8dc6725..a2d84eec 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -91,6 +91,7 @@ reference: - report.stanreg - report.test_performance - report.estimate_contrasts + - report.compare.loo - title: Report Non-Statistical Objects desc: | From 4151919f10916bb1bd9df9b93d6cb7e3ef5076e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:06:19 +0100 Subject: [PATCH 06/11] fix lints --- R/report.compare.loo.R | 13 ++++++------- man/report.compare.loo.Rd | 9 +++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index 9a39cd04..96207e8c 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -59,16 +59,15 @@ report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { if (index == "ELPD") { index_label <- sprintf("Expected Log Predictive Density (ELPD-%s)", type) - } else { - if (type == "LOO") { + } else if (type == "LOO") { index_label <- "Leave-One-Out CV Information Criterion (LOOIC)" } else { index_label <- "Widely Applicable Information Criterion (WAIC)" - } } - text <- sprintf( - "The difference in predictive accuracy, as index by %s, suggests that '%s' is the best model (effective number of parameters (ENP) = %.2f), followed by", + out_text <- sprintf(paste( + "The difference in predictive accuracy, as index by %s, suggests that '%s' ", + "is the best model (effective number of parameters (ENP) = %.2f), followed by"), index_label, modnames[1], ENP[1] ) @@ -102,7 +101,7 @@ report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { other_texts <- paste0(other_texts, sep, collapse = "") - text <- paste(text, other_texts, collapse = "") + out_text <- paste(out_text, other_texts, collapse = "") class(text) <- c("report_text", class(text)) - text + out_text } diff --git a/man/report.compare.loo.Rd b/man/report.compare.loo.Rd index b95c4af1..47c2ff3b 100644 --- a/man/report.compare.loo.Rd +++ b/man/report.compare.loo.Rd @@ -32,12 +32,13 @@ distributed. \donttest{ library(brms) -m1 <- brms::brm(mpg ~ qsec, data=mtcars) -m2 <- brms::brm(mpg ~ qsec + drat, data=mtcars) +m1 <- brms::brm(mpg ~ qsec, data = mtcars) +m2 <- brms::brm(mpg ~ qsec + drat, data = mtcars) x <- brms::loo_compare(brms::add_criterion(m1, "loo"), - brms::add_criterion(m2, "loo"), - model_names=c("m1", "m2")) + brms::add_criterion(m2, "loo"), + model_names = c("m1", "m2") +) report(x) } \dontshow{\}) # examplesIf} From 95bafb2aae2719e2d785943fcecd034698e5592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:13:01 +0100 Subject: [PATCH 07/11] styler --- R/report.compare.loo.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index 96207e8c..ac8f8029 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -60,14 +60,16 @@ report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { if (index == "ELPD") { index_label <- sprintf("Expected Log Predictive Density (ELPD-%s)", type) } else if (type == "LOO") { - index_label <- "Leave-One-Out CV Information Criterion (LOOIC)" - } else { - index_label <- "Widely Applicable Information Criterion (WAIC)" + index_label <- "Leave-One-Out CV Information Criterion (LOOIC)" + } else { + index_label <- "Widely Applicable Information Criterion (WAIC)" } - out_text <- sprintf(paste( - "The difference in predictive accuracy, as index by %s, suggests that '%s' ", - "is the best model (effective number of parameters (ENP) = %.2f), followed by"), + out_text <- sprintf( + paste( + "The difference in predictive accuracy, as index by %s, suggests that '%s' ", + "is the best model (effective number of parameters (ENP) = %.2f), followed by" + ), index_label, modnames[1], ENP[1] ) From 4191203c400415659374db01516545d42a60adaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Sat, 30 Mar 2024 10:26:10 +0100 Subject: [PATCH 08/11] bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a38edffe..96dfeec9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: report Type: Package Title: Automated Reporting of Results and Statistical Models -Version: 0.5.8.1 +Version: 0.5.8.2 Authors@R: c(person(given = "Dominique", family = "Makowski", From a382b06bb602440448266bc4f7c17d192ee25e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:23:45 +0200 Subject: [PATCH 09/11] update readme, and #no lint start for long URL lint --- NEWS.md | 6 ++++++ R/report.compare.loo.R | 2 ++ 2 files changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4a52b5b5..00b229cb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# report 0.5.9 + +Minor changes + +* `report` now supports reporting of Bayesian model comparison with variables of class `brms::loo_compare`. + # report 0.5.8 New features diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index ac8f8029..8d78c425 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -31,7 +31,9 @@ #' @return Objects of class [report_text()]. #' @export report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { + #no lint start # https://stats.stackexchange.com/questions/608881/how-to-interpret-elpd-diff-of-bayesian-loo-estimate-in-bayesian-logistic-regress + #no lint end # https://users.aalto.fi/%7Eave/CV-FAQ.html#12_What_is_the_interpretation_of_ELPD__elpd_loo__elpd_diff # https://users.aalto.fi/%7Eave/CV-FAQ.html#se_diff From 919f0799aac31517f1efbdc10f6cd596e05a0de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:34:37 +0200 Subject: [PATCH 10/11] styler # no lint start with space --- R/report.compare.loo.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index 8d78c425..581b7650 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -31,9 +31,9 @@ #' @return Objects of class [report_text()]. #' @export report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { - #no lint start + # no lint start # https://stats.stackexchange.com/questions/608881/how-to-interpret-elpd-diff-of-bayesian-loo-estimate-in-bayesian-logistic-regress - #no lint end + # no lint end # https://users.aalto.fi/%7Eave/CV-FAQ.html#12_What_is_the_interpretation_of_ELPD__elpd_loo__elpd_diff # https://users.aalto.fi/%7Eave/CV-FAQ.html#se_diff From 85b33873cfb33f2be5c1ecc3d06be55dba6e5402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Th=C3=A9riault?= <13123390+rempsyc@users.noreply.github.com> Date: Mon, 1 Apr 2024 11:42:47 +0200 Subject: [PATCH 11/11] # nolint start remove space..... --- R/report.compare.loo.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/report.compare.loo.R b/R/report.compare.loo.R index 581b7650..7225dae4 100644 --- a/R/report.compare.loo.R +++ b/R/report.compare.loo.R @@ -31,9 +31,9 @@ #' @return Objects of class [report_text()]. #' @export report.compare.loo <- function(x, index = c("ELPD", "IC"), ...) { - # no lint start + # nolint start # https://stats.stackexchange.com/questions/608881/how-to-interpret-elpd-diff-of-bayesian-loo-estimate-in-bayesian-logistic-regress - # no lint end + # nolint end # https://users.aalto.fi/%7Eave/CV-FAQ.html#12_What_is_the_interpretation_of_ELPD__elpd_loo__elpd_diff # https://users.aalto.fi/%7Eave/CV-FAQ.html#se_diff