Skip to content

Feature idea: cache results of CmdStanMCMC.summary() #845

@amas0

Description

@amas0

The CmdStanMCMC.summary() method runs stansummary under the hood (passing appropriate arguments to the command call). In large models with draws from thousands of quantities, computing this summary can be pretty slow. If one wants to re-use the summary results, the output dataframe needs to stored in a new variable. I think a small quality-of-life feature would be to cache the results of this call within the fit object so in code where .summary() is called more than once on a single fit, we don't re-run the summary (this is something I run into quite often in models I run).

In comparison to the loading we do of draws into memory when accessed via the fit object, the extra memory cost of also storing the summary would be minimal.

Should be an easy implementation if this is something we want to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions