-
-
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
Add a function to extract single draw of multidimensional variable #340
Comments
Thinking about how this relates to uses of variable names across the API, this seems related to the inconsistent handling of indices in variable names between draws_rvars and the other formats (see here: #208 (comment)) One thought is to fix the above-referenced issue so that something like For this issue specifically, following the pattern of If we also want a solution specifically for getting one draw regardless of shape, then there is helper code used by for_each_draw that could be extracted and adapted for that purpose. |
I did also notice the index-inconsistency, and like the idea of
|
I agree. Sounds like a good solution. |
Cool, happy to take a stab at it. |
Currently
extract_variable
doesn't work for matrix/array variablesIn the following
p1
is a Pathfinder object from CmdStanR andz_1
is defined in Stan asmatrix[M_1, N_1] z_1;
It took me some time to figure out how to extract an R array with the dimensions
M_1
,N_1
It would be nice to have a function for this. The above code works also for scalars, vectors, and 1D arrays.
The text was updated successfully, but these errors were encountered: