-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
rvar
conversion drops dimensions
#265
Comments
@mjskay would be great if you could have a look at this.... or may I also attempt to fix this issue myself and provide a PR? |
Happy to look, though the absolute earliest would likely be next week or the week after. Alternatively if you wanted to work on a PR that sounds good to me! 😊 |
mjskay
added a commit
that referenced
this issue
Jan 25, 2023
mjskay
added a commit
that referenced
this issue
Jan 25, 2023
ensure as_draws_rvars preserves dims of length-1 arrays, closes #265
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
rvar
creation utilities do drop dimensions from the input variables whenever just 1 entry lives in the last index as it seems. Here is a minimal example:You see that
mu
is a matrix of dimension 1x1, which I can create withrdo
. Converting it to an array and then back to anrvar
gets rid of the last dimension. This is with posterior 1.3.0.The offending code in
posterior
seems to be here:https://github.com/stan-dev/posterior/blob/master/R/as_draws_rvars.R#L78-L82
This misbehaviour triggers a problem in OncoBayes2 in a special case:
Tagging @mjskay here... seems to be another corner case to catch?
The text was updated successfully, but these errors were encountered: