Skip to content

Commit 03576d9

Browse files
springcoiltwiecki
authored andcommitted
Updating docs
1 parent 0d0abdb commit 03576d9

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

docs/source/api/data.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*****
2+
Data
3+
*****
4+
5+
.. currentmodule:: pymc3.data
6+
7+
.. automodule:: pymc3.data
8+
:members:

docs/source/api/sampling.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
********
2+
Sampling
3+
********
4+
5+
.. currentmodule:: pymc3.sampling
6+
7+
.. automodule:: pymc3.sampling
8+
:members:

pymc3/sampling.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,30 @@ def sample(draws, step=None, init='ADVI', n_init=200000, start=None,
149149
-------
150150
trace : pymc3.backends.base.MultiTrace
151151
A `MultiTrace` object that contains the samples.
152+
153+
Examples
154+
--------
155+
.. code:: ipython
156+
157+
>>> import pymc3 as pm
158+
... import numpy as np
159+
... np.random.seed(20090425)
160+
... n = 20
161+
... X = np.sort(3*np.random.rand(n))
162+
163+
Now let's set up a model and sample from it.
164+
165+
.. code:: ipython
166+
>>> with pm.Model() as model:
167+
... b0 = pm.Normal('b0', mu=0, sd=100)
168+
... yest = b0 * X
169+
...
170+
>>> with model:
171+
... trc = pm.sample(100)
172+
...
173+
>>> pm.df_summary(trc)
174+
mean sd mc_error hpd_2.5 hpd_97.5
175+
b0 7.004575 76.547562 7.654756 -161.098322 136.327346
152176
"""
153177
model = modelcontext(model)
154178

0 commit comments

Comments
 (0)