-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Updating docs - Added an example to sampling and added sampling to the docs #1970
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
***** | ||
Data | ||
***** | ||
|
||
.. currentmodule:: pymc3.data | ||
|
||
.. automodule:: pymc3.data | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
******** | ||
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. This is already in |
||
Sampling | ||
******** | ||
|
||
.. currentmodule:: pymc3.sampling | ||
|
||
.. automodule:: pymc3.sampling | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,30 @@ def sample(draws, step=None, init='ADVI', n_init=200000, start=None, | |
------- | ||
trace : pymc3.backends.base.MultiTrace | ||
A `MultiTrace` object that contains the samples. | ||
|
||
Examples | ||
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. Good idea, that was definitely missing. |
||
-------- | ||
.. code:: ipython | ||
|
||
>>> import pymc3 as pm | ||
... import numpy as np | ||
... np.random.seed(20090425) | ||
... n = 20 | ||
... X = np.sort(3*np.random.rand(n)) | ||
|
||
Now let's set up a model and sample from it. | ||
|
||
.. code:: ipython | ||
>>> with pm.Model() as model: | ||
... b0 = pm.Normal('b0', mu=0, sd=100) | ||
... yest = b0 * X | ||
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. This doesn't do anything. Did you forget an observed var here? |
||
... | ||
>>> with model: | ||
... trc = pm.sample(100) | ||
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. I'd prefer |
||
... | ||
>>> pm.df_summary(trc) | ||
mean sd mc_error hpd_2.5 hpd_97.5 | ||
b0 7.004575 76.547562 7.654756 -161.098322 136.327346 | ||
""" | ||
model = modelcontext(model) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add new files to the toctree in
source/api.rst
, or they won't show up in the documentation.