diff --git a/R/cpp_opts.R b/R/cpp_opts.R index 3626f2e2..edf584eb 100644 --- a/R/cpp_opts.R +++ b/R/cpp_opts.R @@ -2,6 +2,7 @@ # running and parsing exe info -------------------------------- # run info command +#' @noRd #' @example `.cmdstan/bin` run_info_cli <- function(exe_file) { withr::with_path( @@ -52,7 +53,7 @@ parse_exe_info_string <- function(ret_stdout) { model_compile_info <- function(exe_file, version) { info <- NULL if (version > "2.26.1") { - + ret <- run_info_cli(exe_file) if (ret$status == 0) { info <- list() diff --git a/R/fit.R b/R/fit.R index bb14cbff..a2126a49 100644 --- a/R/fit.R +++ b/R/fit.R @@ -1501,12 +1501,15 @@ CmdStanMCMC <- R6::R6Class( #' containing the pointwise log-likelihood. The default is to look for #' `"log_lik"`. This argument is passed to the [`$draws()`][fit-method-draws] #' method. -#' @param r_eff (multiple options) How to handle the `r_eff` argument for `loo()`: -#' * `TRUE` (the default) will automatically call [loo::relative_eff.array()] -#' to compute the `r_eff` argument to pass to [loo::loo.array()]. -#' * `FALSE` or `NULL` will avoid computing `r_eff` (which can sometimes be slow), -#' but the reported ESS and MCSE estimates can be over-optimistic if the -#' posterior draws are not (near) independent. +#' @param r_eff (multiple options) How to handle the `r_eff` argument for +#' `loo()`. `r_eff` measures the amount of autocorrelation in MCMC draws, and +#' is used to compute more accurate ESS and MCSE estimates for pointwise and +#' total ELPDs. +#' * `TRUE` will call [loo::relative_eff.array()] to compute the `r_eff` +#' argument to pass to [loo::loo.array()]. +#' * `FALSE` (the default) or `NULL` will avoid computing `r_eff`, +#' which can be very slow. The reported ESS and MCSE estimates may be +#' over-optimistic if the posterior draws are far from independent. #' * If `r_eff` is anything else, that object will be passed as the `r_eff` #' argument to [loo::loo.array()]. #' @param moment_match (logical) Whether to use a @@ -1537,7 +1540,7 @@ CmdStanMCMC <- R6::R6Class( #' print(loo_result) #' } #' -loo <- function(variables = "log_lik", r_eff = TRUE, moment_match = FALSE, ...) { +loo <- function(variables = "log_lik", r_eff = FALSE, moment_match = FALSE, ...) { require_suggested_package("loo") if (length(variables) != 1) { stop("Only a single variable name is allowed for the 'variables' argument.", call. = FALSE) diff --git a/man/fit-method-loo.Rd b/man/fit-method-loo.Rd index 8a63681a..d2ccb471 100644 --- a/man/fit-method-loo.Rd +++ b/man/fit-method-loo.Rd @@ -5,7 +5,7 @@ \alias{loo} \title{Leave-one-out cross-validation (LOO-CV)} \usage{ -loo(variables = "log_lik", r_eff = TRUE, moment_match = FALSE, ...) +loo(variables = "log_lik", r_eff = FALSE, moment_match = FALSE, ...) } \arguments{ \item{variables}{(string) The name of the variable in the Stan program @@ -13,13 +13,16 @@ containing the pointwise log-likelihood. The default is to look for \code{"log_lik"}. This argument is passed to the \code{\link[=fit-method-draws]{$draws()}} method.} -\item{r_eff}{(multiple options) How to handle the \code{r_eff} argument for \code{loo()}: +\item{r_eff}{(multiple options) How to handle the \code{r_eff} argument for +\code{loo()}. \code{r_eff} measures the amount of autocorrelation in MCMC draws, and +is used to compute more accurate ESS and MCSE estimates for pointwise and +total ELPDs. \itemize{ -\item \code{TRUE} (the default) will automatically call \code{\link[loo:relative_eff]{loo::relative_eff.array()}} -to compute the \code{r_eff} argument to pass to \code{\link[loo:loo]{loo::loo.array()}}. -\item \code{FALSE} or \code{NULL} will avoid computing \code{r_eff} (which can sometimes be slow), -but the reported ESS and MCSE estimates can be over-optimistic if the -posterior draws are not (near) independent. +\item \code{TRUE} will call \code{\link[loo:relative_eff]{loo::relative_eff.array()}} to compute the \code{r_eff} +argument to pass to \code{\link[loo:loo]{loo::loo.array()}}. +\item \code{FALSE} (the default) or \code{NULL} will avoid computing \code{r_eff}, +which can be very slow. The reported ESS and MCSE estimates may be +over-optimistic if the posterior draws are far from independent. \item If \code{r_eff} is anything else, that object will be passed as the \code{r_eff} argument to \code{\link[loo:loo]{loo::loo.array()}}. }}