Skip to content

Commit

Permalink
fix issue #1625
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Mar 19, 2024
1 parent 332cd55 commit 0102e6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ summary.brmsfit <- function(object, priors = FALSE, prob = 0.95,
algorithm = algorithm(object)
)
class(out) <- "brmssummary"
if (!length(object$fit@sim)) {
# the model does not contain posterior draws

# check if the model contains any posterior draws
model_is_empty <- !length(object$fit@sim) ||
isTRUE(object$fit@sim$iter <= object$fit@sim$warmup)
if (model_is_empty) {
return(out)
}

stan_args <- object$fit@stan_args[[1]]
out$sampler <- paste0(stan_args$method, "(", stan_args$algorithm, ")")
if (priors) {
Expand Down

0 comments on commit 0102e6d

Please sign in to comment.