Questions tagged [pymc3]

PyMC (formerly PyMC3) is a Python module that implements Bayesian statistical models and fitting algorithms, including Markov chain Monte Carlo. Its flexibility and extensibility make it applicable to a large suite of problems. Along with core sampling functionality, PyMC includes methods for summarizing output, plotting, goodness-of-fit and convergence diagnostics.

PyMC is a Python module that implements Bayesian statistical models and fitting algorithms, including Markov chain Monte Carlo.

Its flexibility and extensibility make it applicable to a large suite of problems. Along with core sampling functionality, PyMC includes methods for summarizing output, plotting, goodness-of-fit and convergence diagnostics.

706 questions
3
votes
1 answer

Bayes factors in pymc3

I'm interested in computing Bayes factors to compare two models in PyMC 3. According to this website, in PyMC 2, the procedure seems relatively straightforward: include a Bernoulli random variable and a custom likelihood function, which returns the…
sammosummo
  • 495
  • 1
  • 7
  • 17
3
votes
1 answer

PyMC3 Multivariate Mixture Model: Constraining components to be non-empty

I am implementing a Personalized Mixture of Multivariate Gaussian Regressions in pymc3 and running into an issue with empty components. After referring to the related PyMC3 mixture model example, I tried implementing the model using univariate…
Mack
  • 2,614
  • 2
  • 21
  • 33
3
votes
1 answer

pymc3 SQLite backend, specify list of variables to track

I am fitting a hierarchical model where one variable has a shape>10K and the model requires 500+k samples to converge. I would like to use a persistent backend for trace, so that I can compare different models later. I tried to use SQLite backend, I…
volodymyr
  • 7,256
  • 3
  • 42
  • 45
3
votes
3 answers

Theano step gives File in wrong format error

I am trying to replicate the example Getting Started PyMC3. on Windows 2012 R2. The step from pymc3 import Model, Normal, HalfNormal gives D:\Anaconda3\libs/python35.lib: error adding symbols: File in wrong format collect2.exe: error: ld returned 1…
tugrul
  • 117
  • 5
3
votes
1 answer

Hierarchical modeling categorical variable interactions in PyMC3

I'm attempting to use PyMC3 to implement a hierarchical model with categorical variables and their interactions. In R, the formula would take the form of something like: y ~ x1 + x2 + x1:x2 However, on the tutorial…
John Hanna
  • 33
  • 4
3
votes
1 answer

Trying to follow the tutorial on PyMC3, it comes to: "'Model' object has no attribute TransformedVar"

I have been trying to follow the tutorial on PYMC3 https://pymc-devs.github.io/pymc3/getting_started/, but when I get to the following section of code, I run into errors... from pymc3 import Exponential, T, logtransform, exp, Deterministic from…
user5280442
  • 33
  • 1
  • 5
3
votes
1 answer

pymc3's NUTS can't perform well with my hierarchical model for Bayesian Neural Nets?

I have a Hierarchical model for learning Bayesian networks with only single hidden layer . Network parameters are divided to 4 groups of input-to-hidden and hidden-to-output weights and biases. A Gaussian prior is defined over each parameter group.…
mashall aryan
  • 71
  • 1
  • 6
3
votes
1 answer

How to handle shape of pymc3 Deterministic variables

I've been working on getting a hierarchical model of some psychophysical behavioral data up and running in pymc3. I'm incredibly impressed with things overall, but after trying to get up to speed with Theano and pymc3 I have a model that mostly…
Michael
  • 31
  • 3
3
votes
1 answer

Bayesian Lasso using PyMC3

I'm trying to reproduce the results of this tutorial (see LASSO regression) on PyMC3. As commented on this reddit thread, the mixing for the first two coefficients wasn't good because the variables are correlated. I tried implementing it in PyMC3…
Pedro Tabacof
  • 291
  • 2
  • 10
3
votes
1 answer

Multinomial Logistic Regression - pymc3

I've started trying out pymc3 and need to implement a multinomial logistic regression model. I've studied twiecki's tutorials and I understand his implementations of hierarchical regression models (see…
3
votes
1 answer

How to define a custom prior in PyMC3

I would like to know if it is possible to define a custom prior in PyMC3 (and how to do it). From here it seems that in PyMC2 is relatively easy to do (without the need to modified the source code), but in PyMC3 is not that easy (or I am not…
aloctavodia
  • 2,040
  • 21
  • 28
3
votes
1 answer

Pymc3: very slow and stalling

is there any reason why the NUTS sampler might be slow or stall? I'm using http://twiecki.github.io/blog/2014/03/17/bayesian-glms-3/ as a basis for some hierachical linear regression work. I've tried starting with find_MAP() and it's still stalls…
jonnydedwards
  • 180
  • 10
2
votes
0 answers

Implementing ERGMs with PyMC

I am trying to implement ERGMs with PyMC. I've found this, this, this and this, but these resources are a bit dated. I have an NxN matrix for each network statistic (density, triangles, istar2, istar3 & distance). Each cell in each matrix…
Neotenic Primate
  • 313
  • 3
  • 13
2
votes
1 answer

Error when observing on uniform with sampled parameters in PyMC

I’m new to PyMC and am trying to model a situation where you are rolling marbles at a wall and trying to find the block. The data is only for the values where the marble hits the block. I’m first sampling an x location and size and then calculating…
lovefaithswing
  • 1,510
  • 1
  • 21
  • 37
2
votes
1 answer

Strange result from pymc3 for small change in the variable

I have below model for which I seek estimation of parameters using pymc3 import pandas as pd import pymc3 as pm import arviz as arviz myData = pd.DataFrame.from_dict({ 'Unnamed: 0': { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8:…
Bogaso
  • 2,838
  • 3
  • 24
  • 54