Skip to content

Commit

Permalink
improve parameter class names in the summary output
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Dec 19, 2023
1 parent 6377885 commit 0a13895
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: brms
Encoding: UTF-8
Type: Package
Title: Bayesian Regression Models using 'Stan'
Version: 2.20.7
Version: 2.20.8
Date: 2023-12-14
Authors@R:
c(person("Paul-Christian", "Bürkner", email = "paul.buerkner@gmail.com",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* No longer automatically canonicalize the Stan code if cmdstanr is used
as backend. (#1544)
* Improve parameter class names in the `summary` output.

### Bug Fixes

Expand Down
15 changes: 8 additions & 7 deletions R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,19 @@ print.brmssummary <- function(x, digits = 2, ...) {
))
}
cat("\n")
# TODO: change order of the displayed summaries?
if (nrow(x$prior)) {
cat("Priors: \n")
cat("Priors:\n")
print(x$prior, show_df = FALSE)
cat("\n")
}
if (length(x$splines)) {
cat("Smooth Terms: \n")
cat("Smoothing Spline Hyperparameters:\n")
print_format(x$splines, digits)
cat("\n")
}
if (length(x$gp)) {
cat("Gaussian Process Terms: \n")
cat("Gaussian Process Hyperparameters:\n")
print_format(x$gp, digits)
cat("\n")
}
Expand All @@ -276,7 +277,7 @@ print.brmssummary <- function(x, digits = 2, ...) {
cat("\n")
}
if (length(x$random)) {
cat("Group-Level Effects: \n")
cat("Multilevel Hyperparameters:\n")
for (i in seq_along(x$random)) {
g <- names(x$random)[i]
cat(paste0("~", g, " (Number of levels: ", x$ngrps[[g]], ") \n"))
Expand All @@ -285,17 +286,17 @@ print.brmssummary <- function(x, digits = 2, ...) {
}
}
if (nrow(x$fixed)) {
cat("Population-Level Effects: \n")
cat("Regression Coefficients:\n")
print_format(x$fixed, digits)
cat("\n")
}
if (length(x$mo)) {
cat("Simplex Parameters: \n")
cat("Monotonic Simplex Parameters:\n")
print_format(x$mo, digits)
cat("\n")
}
if (nrow(x$spec_pars)) {
cat("Family Specific Parameters: \n")
cat("Further Distributional Parameters:\n")
print_format(x$spec_pars, digits)
cat("\n")
}
Expand Down

0 comments on commit 0a13895

Please sign in to comment.