You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the discussion around #1473, it was mentioned that changes after 2.17 to the cmdstanr-to-stanfit conversion code had somehow introduced errors when using variational inference. After looking into this, I found that even before the change, brms has been creating a "broken" stanfit object. The example below was tested in 2.17 and on the latest dev version and the result is the same:
# remotes::install_github("paul-buerkner/brms@a43937c")
library(brms)
options(brms.backend="cmdstanr")
n<-100d<-data.frame(x= rnorm(n))
d$y<- rnorm(n, d$x)
fit1<- brm(y~x, data=d, algorithm="meanfield")
#> Start sampling [...]fit1$fit#> Error in dim(s1) <- c(length(tidx), length(m) + 5L): dims [product 80] do not match the length of object [72]
The source of the error is the summary method for the stanfit object, which expects to find khat as part of the summaries, which does not seem to be something that cmdstanr produces. Source.
This error isn't too critical as it is only triggered if one tries to print the stanfit object itself and everything else seems to work fine otherwise, but it's also not so easily debugged as it comes from an S4 method that the user won't be able to see unless the rstan library has been loaded.
The text was updated successfully, but these errors were encountered:
In the discussion around #1473, it was mentioned that changes after 2.17 to the cmdstanr-to-stanfit conversion code had somehow introduced errors when using variational inference. After looking into this, I found that even before the change,
brms
has been creating a "broken" stanfit object. The example below was tested in 2.17 and on the latest dev version and the result is the same:The source of the error is the
summary
method for thestanfit
object, which expects to findkhat
as part of the summaries, which does not seem to be something thatcmdstanr
produces. Source.This error isn't too critical as it is only triggered if one tries to print the stanfit object itself and everything else seems to work fine otherwise, but it's also not so easily debugged as it comes from an S4 method that the user won't be able to see unless the
rstan
library has been loaded.The text was updated successfully, but these errors were encountered: