diff --git a/docs/source/api.rst b/docs/source/api.rst index 1ec1a12c0b..828fbc49a2 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -16,3 +16,4 @@ API Reference api/diagnostics api/backends api/math + api/data \ No newline at end of file diff --git a/docs/source/api/data.rst b/docs/source/api/data.rst new file mode 100644 index 0000000000..bf5b65d898 --- /dev/null +++ b/docs/source/api/data.rst @@ -0,0 +1,8 @@ +***** +Data +***** + +.. currentmodule:: pymc3.data + +.. automodule:: pymc3.data + :members: \ No newline at end of file diff --git a/docs/source/api/inference.rst b/docs/source/api/inference.rst index 5224d5e8d0..efbefb82dd 100644 --- a/docs/source/api/inference.rst +++ b/docs/source/api/inference.rst @@ -65,3 +65,11 @@ ADVI minibatch .. automodule:: pymc3.variational.advi_minibatch :members: + +ADVI approximations +^^^^^^^^^^^^^^^^^^^ + +.. currentmodule:: pymc3.variational.approximations + +.. automodule:: pymc3.variational.approximations + :members: diff --git a/pymc3/sampling.py b/pymc3/sampling.py index 5220ff0b76..be64d820f3 100644 --- a/pymc3/sampling.py +++ b/pymc3/sampling.py @@ -149,6 +149,26 @@ 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 + -------- + .. code:: ipython + + >>> import pymc3 as pm + ... n = 100 + ... h = 61 + ... alpha = 2 + ... beta = 2 + + .. code:: ipython + + >>> with pm.Model() as model: # context management + ... p = pm.Beta('p', alpha=alpha, beta=beta) + ... y = pm.Binomial('y', n=n, p=p, observed=h) + ... trace = pm.sample(2000, tune=1000, njobs=4) + >>> pm.df_summary(trace) + mean sd mc_error hpd_2.5 hpd_97.5 + p 0.604625 0.047086 0.00078 0.510498 0.694774 """ model = modelcontext(model)