Skip to content

Parameter vectors of length 1 are dropped from results$stats #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lunafazio opened this issue Nov 6, 2022 · 2 comments
Open

Parameter vectors of length 1 are dropped from results$stats #73

lunafazio opened this issue Nov 6, 2022 · 2 comments
Assignees

Comments

@lunafazio
Copy link
Contributor

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.

Reprex here.

(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)

@martinmodrak martinmodrak self-assigned this Nov 6, 2022
@martinmodrak
Copy link
Collaborator

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 stan-dev/posterior#187 is resolved. But I agree that in the meantime we might want to provide some workaround.

@martinmodrak
Copy link
Collaborator

Note to self: the currently developed system for variable attributes could be used to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants