SBC
SBC copied to clipboard
Parameter vectors of length 1 are dropped from results$stats
It seems SBC
doesn't expect a length 1 variable to have an index, but if this corresponds to a vector parameter, Stan will still append an index to the parameter name. Therefore when intersect
is used here, parameter vectors of length 1 will be dropped from the $stats output.
(I'm just sharing this for awareness as SBC still warns that a variable has been dropped and a user-side workaround is fairly simple)
Thanks for reporting this. The underlying problem here is that R does not distinguish between a scalar and vector of length 1 while C++ and Stan do. In best case scenario, this problem could automatically disappear once https://github.com/stan-dev/posterior/issues/187 is resolved. But I agree that in the meantime we might want to provide some workaround.
Note to self: the currently developed system for variable attributes could be used to resolve this.