Questions tagged [arviz]

ArviZ is a Python package for exploratory analysis of Bayesian models. Includes functions for posterior analysis, sample diagnostics, model checking, and comparison.

ArviZ is a Python package for exploratory analysis of Bayesian models. It includes functions for posterior analysis, sample diagnostics, model checking, and comparison.

ArviZ supports the import of inference data from:

40 questions
1
vote
1 answer

plot multiple scatterplots from hierarchical model with 2 predictors

I am brand new to python and pymc3. So forgive me if this question is rather silly. I have a dataset called…
clueless
  • 11
  • 2
1
vote
1 answer

For the command pm.plot_posterior of pymc3

Usually, I find we use the pm.binomial() and so forth. and using the pm.plot_posterior we get the Discrete graph, my question is why my graph I have to get is a curve? Could someone enlighten me? I want to get: But I get the graph:
Hello
  • 13
  • 2
1
vote
0 answers

Observed curve from az.plot_ppc does not match kde plot of actual data

I am modeling data that I think is gamma distributed so I write a PyMC3 model as below. import pymc3 as pm import arviz as az with pm.Model() as model2: alpha = pm.Exponential('alpha', 5) beta = pm.Exponential('beta', 5) p_factor =…
kwespiipi
  • 11
  • 3
1
vote
1 answer

Arviz and Bokeh: Trying to change the title of the plot using backend kwargs

I am trying to change the title of the plot I'm creating with Arviz. Usually I have done this using the backend_kwargs but it doesn't seem to work for certain plots: in this case the plot_density. This is the code i'm using: kwg =…
1
vote
1 answer

effective sample size 2d array using arviz and pymc3 mcmc

I'm trying to get the effective sample size for a 2D mcmc chain, using pymc3 and arviz import pymc3 as pm3 !pip install arviz import arviz as az ess = az.ess(samples) The above code works for 1D, but not for 2D, and I see there is a…
1
vote
0 answers

arviz.plot_ppc: "posterior predictive mean"

Hello! After running a model for a simple linear regression model in pymc3, I'm trying to do a plot. As you can see both plots show the "posterior predictive mean score", but I was wondering whether can I plot this distribution around the…
Nip
  • 387
  • 4
  • 11
1
vote
1 answer

ArviZ plot_trace does not properly plot multidimensional variables

I'm attempting to run a basic test model using PyMC3, but I've found the ArviZ plot_trace function won't properly show my traces. Code from scipy import stats import arviz as az import numpy as np import matplotlib.pyplot as plt import pymc3 as…
Matt
  • 11
  • 2
1
vote
0 answers

When trying to install arviz I get the following error msg: "Error: python setup.py egg_info" failed with error code 1

I have already tried using: pip install --upgrade setuptools pip install ez_setup I need to install arviz to visualize the out of pystan. I am using python 3 on windows 10 (anaconda distribution).
Aditya Lahiri
  • 409
  • 3
  • 11
0
votes
0 answers

Bayesian framework: Plot prior predictive and posterior predictive distribution with arviz

I'm attempting to replicate the example in Figure 1.5 from this source, which illustrates the prior predictive and posterior predictive distributions. However, I'm facing difficulty comprehending what exactly needs to be plotted. Given that I intend…
JCV
  • 447
  • 1
  • 5
  • 15
0
votes
0 answers

arviz 'AxesSubplot' object has no attribute 'sharey' on Colab

Does someone else experience trace on simple arviz exemple see nb on Colab Here is the snippet import arviz as az #0.12.1 import numpy as np # This Plot is ok data = {'a':np.random.normal(size=(100,)), "b":np.random.normal(size=(100,)),…
Jean-Eric
  • 372
  • 2
  • 14
0
votes
0 answers

How are built the abscissa-axis in Python arviz plots from PyMC?

I am working on Python package PyMC, using the examples shown in this introductory page Introductory Overview of PyMC, available HERE. After running az.plot_trace(idata), the usual plots are shown (in $ named Posterior analysis) and the following…
Andrew
  • 926
  • 2
  • 17
  • 24
0
votes
0 answers

Obtaining conditional posterior probabilities in ArviZ

I am trying to plot a conditional posterior probability using ArviZ. Imagine I have an InferenceData object of some sort, that I have obtained via an Markov Chain. For instance, let us assume that I have two variables: a discrete variable $u$, that…
masca
  • 1
  • 1
0
votes
0 answers

How could it be that Python module `arviz` has no attribute `plots`?

I tried to run this program: import pymc3 as pm import theano.tensor as tt import scipy from scipy import optimize but I got in return some non understandable…
Andrew
  • 926
  • 2
  • 17
  • 24
0
votes
0 answers

How to add raw (frequentist) estimates to forest plot

Let's say I want to add raw point estimates with 95% confidence intervals to forest plot. What's the best way to achieve that? Here's a simple example of creating a forest plot (without frequentist/raw estimates): import bambi as bmb import pandas…
mihagazvoda
  • 1,057
  • 13
  • 23
0
votes
1 answer

pymc3 HDI HPD confusion

I have tried to replicate a number of examples using pymc3 and compared the results. Below is the example for estimating HPD: import pymc3 import arviz as az import numpy as np import warnings warnings.filterwarnings("ignore") import…
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286