Extracting draws from cmdstanr: array vs. df

Hi, is there any difference between extracting posterior draws from cmdstanr as array vs. df? I mean, using the draws_array vs draws_df in posterior or bayesplot?

From my own test, I don’t see a difference in very simple models. But could there be a speed gain in more complex models with more parameters? Please enlighten me. Thank you.

As far as I know there won’t be a speed difference between the two formats, the primary decision is which format would be the best for your use-case. In other words, it will be more efficient to choose a format that requires less post-processing to be in the correct structure/layout for whatever you’re trying to achieve.

For more background on the two formats, I’d recommend these doc pages:

1 Like

There are comments on the posterior doc homepage which suggest that draws_list is the fastest… but one should most of the time just pick what works easiest, just as @andrjohns suggests.