Skip to content

Commit 0799428

Browse files
authored
Merge pull request #379 from stan-dev/clarify-print-vs-summary
clarify print vs summary in doc
2 parents d62160e + c36b49b commit 0799428

File tree

3 files changed

+63
-39
lines changed

3 files changed

+63
-39
lines changed

R/fit.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,16 @@ NULL
502502
#' @aliases summary print.CmdStanMCMC print.CmdStanMLE print.CmdStanVB
503503
#' @description The `$summary()` method runs
504504
#' [`summarise_draws()`][posterior::draws_summary] from the \pkg{posterior}
505-
#' package. For MCMC only post-warmup draws are included in the summary.
505+
#' package and returns the output. For MCMC only post-warmup draws are included
506+
#' in the summary.
506507
#'
507-
#' The `$print()` method prints the same summary but removes the extra
508-
#' formatting used for printing tibbles.
508+
#' The `$print()` method prints the same summary stats but removes the extra
509+
#' formatting used for printing tibbles and returns the fitted model object
510+
#' itself. The `$print()` method may also be faster than `$summary()` because
511+
#' it is designed to only compute the summary statistics for the variables
512+
#' that will actually fit in the printed output (see argument `max_rows`)
513+
#' whereas `$summary()` will compute them for all of the specified variables
514+
#' in order to be able to return them to the user.
509515
#'
510516
#' @section Usage:
511517
#' ```
@@ -1231,7 +1237,7 @@ CmdStanGQ <- R6::R6Class(
12311237
paste(matching_res$not_found, collapse = ", "), call. = FALSE)
12321238
}
12331239
variables <- matching_res$matching
1234-
}
1240+
}
12351241
private$draws_[,,variables]
12361242
},
12371243
output = function(id = NULL) {

docs/reference/fit-method-summary.html

Lines changed: 44 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)