Skip to content

Commit ce8cc5d

Browse files
committed
Fixed bug in brms + rstan
1 parent 188b309 commit ce8cc5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/brms-helpers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ variational_backend_from_stanmodel <- function(stanmodel, args) {
116116

117117
brmsfit_from_stanfit <- function(fit, brmsargs) {
118118
fit_brms <- do.call(brms::brm, combine_args(brmsargs, list(empty = TRUE)))
119-
variables <- fit$metadata()$stan_variables
120119
exclude <- brms:::exclude_pars(fit_brms)
121120
if(inherits(fit, "CmdStanFit")) {
121+
variables <- fit$metadata()$stan_variables
122122
fit_brms$fit <- brms::read_csv_as_stanfit(fit$output_files(),
123123
variables = variables, exclude = exclude, algorithm = fit_brms$algorithm)
124124
if(inherits(fit, "CmdStanVB")) {

0 commit comments

Comments
 (0)