Skip to content
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

pymc3.traceplot() method documentation error #3876

Closed
AlonSpitz opened this issue Apr 8, 2020 · 3 comments
Closed

pymc3.traceplot() method documentation error #3876

AlonSpitz opened this issue Apr 8, 2020 · 3 comments
Labels

Comments

@AlonSpitz
Copy link

AlonSpitz commented Apr 8, 2020

The documentation on pymc3.traceplot() documentation says that the 'compact' argument is 'False' by default, but it seems it is in fact 'True'.

Example (from the Getting started with PyMC3 section):

import pymc3 as pm
basic_model = pm.Model()

with basic_model:

`# Priors for unknows model parameters`
`alpha = pm.Normal('alpha', mu=0, sigma=10)`
`beta  = pm.Normal('beta', mu=0, sigma=10, shape=2)`
`sigma = pm.HalfNormal('sigma', sigma=1)`

`# Expected value of outcome`
`mu = alpha + beta[0]*X1 + beta[1]*X2`

`# Likelihood (samplign distribution of observations`
`Y = pm.Normal('Y_obs', mu=mu, sigma=sigma, observed=Y)`

with basic_model:

`trace = pm.sample(500)`

pm.traceplot(trace);

Above code will show the beta parameter (a vector of shape 2) in a single plot, instead of in two separate plots, though according to the documentation we should expect to get the same result as:

pm.traceplot(trace, compact=False)

Versions and main components

  • PyMC3 Version: 3.8
  • Theano Version: 1.0.4
  • Python Version: 3.7.7
  • Operating system: macOS Catalina, version 10.15.4
  • How did you install PyMC3: conda
@aloctavodia
Copy link
Member

Hi @AlonSpitz tanks for reporting this issue. @ColCarroll I guess the problem is that the docstring is read from az.plot_trace, but PyMC3 is changing that default.

@rpgoldman rpgoldman added the docs label Sep 18, 2020
@ricardoV94
Copy link
Member

This can be closed after #4397 ?

@OriolAbril
Copy link
Member

This can be closed already I think, PyMC3 docs already have only links to ArviZ for plots and stats and the docstring is correct on ArviZ's side, and moreover, the latest ArviZ release has compact=True as a default so there are no differences between plot_trace and pm.traceplot (which will also be removed after #4397)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants