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
4
votes
1 answer

PyMC3 - coal mining disaster example - questions re: adding a second mine

I'm playing around with PyMC3, trying to fit a modified version of the mining disaster switchpoint model in the PyMC3 documentation. Suppose you had two coal-mines (mine1 and mine2), each with similar disaster counts for the same range of…
Sham Doran
  • 41
  • 2
4
votes
2 answers

colaboratory will not acknowledge arviz after installation and import

In Google's colaboratory, installed arviz then did import arviz without error, but in a code cell, pm.plot_posterior(samples) gets error: arviz not installed. Trying to plot Bayesian code pm.plot_posterior(samples) I expect a plot
2tan2ten
  • 109
  • 1
  • 9
2
votes
2 answers

PyMC3/Arviz: CDF value from trace

I have a sample from PyMC3 and I'm trying to get a cumulative probability from it, e.g. P(X < 0). I currently use this: trace = pymc3.sample(return_inferencedata=True) prob_x_lt_zero = (trace.posterior.X < 0).sum() / trace.posterior.X.size Is there…
Christian Aichinger
  • 6,989
  • 4
  • 40
  • 60
2
votes
1 answer

Does pymc3 have an equivalent for the predict method in scikit-learn?

I'm going through the Statistical Rethinking course using PyMC3. At the end of Chapter 4, they ask for the HDI of individual values for data points that were not in the original (!Kung) dataset. Is it possible to do that in PyMC3? In scikit-learn,…
Jean Nassar
  • 555
  • 1
  • 5
  • 13
2
votes
1 answer

Old PyMC3 style grouping traceplot plotted with Arviz

I have an old blogpost where I am training a PyMC3 model. You can find the blogpost here but the gist of the model is shown below. with pm.Model() as model: mu_intercept = pm.Normal('mu_intercept', mu=40, sd=5) mu_slope =…
cantdutchthis
  • 31,949
  • 17
  • 74
  • 114
2
votes
2 answers

Plot fit of gamma distribution with pymc3

Suppose that I generate some sample data using pymc3 for a gamma distribution: import pymc3 as pm import arviz as az # generate fake data: with pm.Model() as model2: g = pm.Gamma('g', alpha=1.7, beta=0.097) syn =…
Vladimir Vargas
  • 1,744
  • 4
  • 24
  • 48
2
votes
1 answer

PyMC3 and Arviz: Visualizing highest posterior density for multiple conditions using arviz plot_hpd

I am trying to visualize simple linear regression with highest posterior density (hpd) for multiple groups. However, I have a problem to apply hpd for each condition. Whenever I ran this code, I am extracting the same posterior density for each…
Cem
  • 93
  • 1
  • 1
  • 13
2
votes
1 answer

How to pass coordinates to arviz / pymc3 function plot_posterior (similar to xarray.Dataset.sel)

I'm doing some Bayesian modelling in pymc3 and would like to plot the posterior distribution using plot_posterior (which comes from the arviz package). The resulting plot is awkwardly misaligned on the horizontal axis, and I would like to shift it…
Sam_W
  • 47
  • 4
1
vote
0 answers

How to pass a coordinate to inference data

I've been skimming through Arviz documentation and came across 8 school inference data. import arviz as az idata = az.load_arviz_data("centered_eight") Inference data object also includes school coordinate. How can I do that with my bambi models? I…
mihagazvoda
  • 1,057
  • 13
  • 23
1
vote
0 answers

How do I to stack arviz.trace_plot() onto an existing matplotlib.plot?

Basically, I have a few plots for the posteriors and the traces for a pymc3 model. I want to stack it in a stable fashion, with the posterior plot and the traceplot in the same line. Any way to do this?
1
vote
1 answer

strange `ArviZ` installation issue

After installing ArviZ in the obvious way (conda install -c conda-forge arviz), I get the following failure. If anyone could shed light on what to do to fix this, that would be great. >>> import arviz as az Traceback (most recent call last): File…
Igor Rivin
  • 4,632
  • 2
  • 23
  • 35
1
vote
1 answer

Got `AttributeError` from `from_pymc3` of ArviZ

I am learning Bayesian inference by the book Bayesian Analysis with Python. However, when using plot_ppc, I got AttributeError and the warning /usr/local/Caskroom/miniconda/base/envs/kaggle/lib/python3.9/site-packages/pymc3/sampling.py:1689:…
ivaquero
  • 69
  • 6
1
vote
1 answer

what is stable release version with regards to pymc3, arviz and theano packages?

I was working with Spyder IDE with python version 3.8.5 and I was using pymc3 (can't remember the exact version) and it was working fine and after upgrading scipy, spyder and python, everything went haywire. I spent the last 2 days trying to sort…
WDpad159
  • 359
  • 3
  • 15
1
vote
1 answer

Summarise the posterior of a single parameter from an array with arviz

I am estimating a model using the pyMC3 library in python. In my "real" model, there are four parameter arrays, two of which have over 170,000 parameters in them. Summarising this array of parameters is too computationally intensive on my…
DaveArmstrong
  • 18,377
  • 2
  • 13
  • 25
1
vote
0 answers

How to reformat the Highest Density Interval (HDI) result on the posterior plot from percentage to float

I conducted a Bayesian mean difference test and obtained the posterior plot of the parameter estimation. I adjusted the HDI probability to 0.995; however, the plot_posterior function of Arviz rounds the probability value to 100% when displaying on…
Serdar
  • 35
  • 3
1
2 3