stan-dev / stan-dev/cmdstanpy

summary for standalone GQ, VI, etc.

Open
#667 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
198
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Summary

Any object returned by sampling should allow .summary() to be called on it to report mean, sd, MCMC SE, quantiles, and R-hat. This includes objects returned by

  • CmdStanMCMC: MCMC sampling
  • CmndStanGQ: generated quantities
  • CmdStanVB: variational inference
  • ???: Laplace approximation

Is Laplace approximation not supported yet in CmdStanPy? It will also return a sample of multiple draws and should also include a .summary() method.

Description

One way to do this would be to have each of these wrapper objects allow the actual draws to be extracted. Right now, there is a high-level "helper" function, where if mcmc_fit is a CmdStanMCMC object, I just call mcmc_fit.summary() directly. I would rather have this work by mcmc_fit.draws() pulling out a simple draws object on which the summary() operates. Then the other object would also support a .draws() extraction and then summary() would be a standalone function that applies to a draws object rather than to the whole output of a run (I don't know what else is in the CmdStanMCMC object---I only ever use the draws).

Current Version

1.1.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the existing CmdStanMCMC.summary() method and the high-level summary helper, then compare the outputs exposed by CmdStanMCMC, CmdStanGQ, and CmdStanVB. Determine how draws are extracted and whether Laplace approximation is supported; done means the supported sampling results have a consistent summary path and the Laplace behavior is explicitly resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.