-
-
Notifications
You must be signed in to change notification settings - Fork 13
docs: add CmdStanPy getting-started example #143
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
Open
patelshivani2283-lab
wants to merge
16
commits into
arviz-devs:main
Choose a base branch
from
patelshivani2283-lab:docs-cmdstanpy-getting-started
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
51c3f3a
docs: mention CmdStanPy conversion in getting started
patelshivani2283-lab 6297ace
docs: add CmdStanPy getting-started section and link conversion guide
patelshivani2283-lab b1a87b7
docs: fix CmdStanPy example to use arviz_base import
patelshivani2283-lab 3d1e4c4
Move CmdStanPy example to dedicated guide and remove from index
patelshivani2283-lab 99e06c5
Alphabetically reorder Tutorials toctree for CmdStanPy guide
patelshivani2283-lab 3b6baf2
changes-complete
patelshivani2283-lab 3218c25
style: apply pre-commit formatting fixes
patelshivani2283-lab d59ff4f
trigger CI
patelshivani2283-lab aba6e34
trigger CI
patelshivani2283-lab e2ac669
fix: update WorkingWithDataTree notebook
patelshivani2283-lab 01b7a8f
Revert unintended changes to conf.py and WorkingWithDataTree notebook
patelshivani2283-lab 2dcbbe1
Update index.md and WorkingWithDataTree notebook
patelshivani2283-lab 6f6ff80
Remove accidental .mdy file
patelshivani2283-lab e04cc1e
Fix tutorial ordering in index.md
patelshivani2283-lab 497ac4b
Fix: restore WorkingWithDataTree as first tutorial in sidebar
patelshivani2283-lab 3ad49a5
Apply pre-commit formatting fixes
patelshivani2283-lab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
|
|
||
| # pylint: disable=redefined-builtin,invalid-name | ||
| """Sphinx configuration file.""" | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # CmdStanPy Conversion Guide | ||
|
|
||
| ArviZ can convert CmdStanPy sampling results into the ArviZ data structure using `from_cmdstanpy`. | ||
|
|
||
| ```python | ||
| import arviz_base as az | ||
| from cmdstanpy import CmdStanModel | ||
|
|
||
| model = CmdStanModel(stan_file="bernoulli.stan") | ||
| fit = model.sample({"N": 10, "y": [0, 1, 0, 0, 0, 0, 0, 0, 0, 1]}) | ||
|
|
||
| idata = az.from_cmdstanpy(posterior=fit) | ||
| az.plot_trace_dist(idata) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # CmdStanPy Conversion Guide | ||
|
|
||
| ArviZ can convert CmdStanPy sampling results into the ArviZ data structure using `from_cmdstanpy`. | ||
|
|
||
| ```python | ||
| import arviz_base as az | ||
| from cmdstanpy import CmdStanModel | ||
|
|
||
| model = CmdStanModel(stan_file="bernoulli.stan") | ||
| fit = model.sample({"N": 10, "y": [0, 1, 0, 0, 0, 0, 0, 0, 0, 1]}) | ||
|
|
||
| idata = az.from_cmdstanpy(posterior=fit) | ||
| az.plot_trace_dist(idata) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,16 +56,15 @@ where `<option>` can be one of: | |
| * `test` (for developers) | ||
| * `doc` (for developers) | ||
|
|
||
|
|
||
OriolAbril marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| You can install multiple bundles of optional dependencies separating them with commas. | ||
| Thus, to install all user facing optional dependencies you should use `arviz-base[netcdf,zarr]` | ||
|
|
||
| :::{toctree} | ||
| :caption: Tutorials | ||
| :hidden: | ||
|
|
||
| tutorial/WorkingWithDataTree | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reverse |
||
| tutorial/label_guide | ||
| how_to/ConversionGuideCmdStanPy | ||
| how_to/ConversionGuideEmcee | ||
| how_to/ConversionGuideNumPyro | ||
| ArviZ in Context <https://arviz-devs.github.io/EABM/> | ||
|
|
@@ -85,4 +84,4 @@ api/index | |
| BlueSky <https://bsky.app/profile/arviz.bsky.social> | ||
| Mastodon <https://bayes.club/@ArviZ> | ||
| GitHub repository <https://github.com/arviz-devs/arviz-base> | ||
| ::: | ||
| ::: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.