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

saving mcmc result for later in pymc3

This question is related to the wonderful pymc3 module. I want to save an mcmc result to disk so that later, when new data comes in, I can use sample_ppc without having to train again. Here is some code that does exactly that, borrowed from…
Charles F
  • 539
  • 6
  • 11
0
votes
1 answer

PyMC3: how to sample from transformed random variable?

I have a super basic PYMC3 question: How do you sample from a transformed RV? I need this mostly for debugging purposes. For example: import pymc3 as pm with pm.Model(): A = pm.Normal('A') B = pm.Deterministic('B', A + 1) # or B = A +…
0
votes
1 answer

Proper specification of a nested logit model in pymc3

I'm working on a nested logistic regression model with 3 outcomes representing choices A, B, or C. The first level represents a choice between A and B or C, and the second level represents the choice between B and C. The code for some made up data…
0
votes
1 answer

Generating random matrices for VAR(p) in PyMC3

I am trying to build a simple VAR(p) model using pymc3, but I'm getting some cryptic errors about incompatible dimensions. I suspect the issue is that I'm not properly generating random matrices. Here is an attempt at VAR(1), any help would be…
Paul
  • 503
  • 4
  • 15
0
votes
1 answer

How to resolve this ValueError in theano?

I have define a function say funA(x) in my python script. This function runs a neural network based on theano. If I call it one time the code runs well. However, if I try to call it several times with different inputs in the loop, for example: for i…
hadesmajesty
  • 51
  • 2
  • 6
0
votes
1 answer

Get the distribution when a point is sampled from a mixture in PyMC3

I have a model with a pm.NormalMixture(), and when I sample from the normal mixture, I also want to know which of the mixed distributions that point is being sampled from. import numpy as np import pymc3 as pm obs =…
Camden Cheek
  • 65
  • 2
  • 7
0
votes
1 answer

How to extract cluster id from Dirichlet process in PyMC3 for grouped data?

I am using PyMC3 to cluster my grouped data. Basically, I have g vectors and would like to cluster the g vectors into m clusters. However, I have two problems. The first one is that, it seems PyMC3 could only deal with one-dimensional data but not…
Hannah
  • 1
0
votes
1 answer

Problems with combining Keras 2.0 and pymc3

I am trying to combine keras 2.0 with pymc3 to build a neural network. It is a modification of the code from Thomas Weicki's Bayesian deep learning II This is the code I have: import numpy as np import pymc3 as pm import theano import theano.tensor…
Ta15
  • 11
  • 3
0
votes
1 answer

pymc3 how to code multi-state discrete Bayes net CPT?

I'm trying to build a simple Bayesian network, where rain and sprinkler are the parents of wetgrass, but rain and sprinkler each have three (fuzzy-logic type rather rather than the usual two boolean) states, and wetgrass has two states (true/false).…
charles.fox
  • 483
  • 4
  • 10
0
votes
1 answer

Using a metric predictor when modelling ordinal predicted variable in PyMC3

I am trying to implement the ordered probit regression model from chapter 23.4 of Doing Bayesian Data Analysis (Kruschke) in PyMC3. After sampling, the posterior distribution for the intercept and slope are not really comparable to the results from…
Jordi
  • 193
  • 9
0
votes
1 answer

Pymc3: how to defined an ordered vector of parameters

I'm trying to do an ordered logistic regression, one parameter of which is an ordered vector of cutpoints. I'm not sure how I can define them. One very stupid way I have come up with is to just define each component of the vector manually, using one…
Olivier Ma
  • 1,269
  • 13
  • 24
0
votes
2 answers

Pymc3 multi-dimensional variable equation

I am trying to use multi-dimensional variables in pymc3 to describe a system of 4 variables that share a common factor. Perhaps I am thinking about this wrong, but when I setup the model I continually get errors from pymc3 about input dimension…
Ryan
  • 53
  • 5
0
votes
0 answers

Theano gcc error?

I am working with pymc3/theano in a pristine conda environment that I created today. I'm running the latest 'bleeding edge' install of theano & pymc3 along with Python2.7.13. I have successfully gotten theano to compile using the MKL version of…
0
votes
1 answer

Using PYMC3 on Windows 10 - theano cannot import name 'floatX'

I'm struggling to get PYMC3 to install correctly on windows. I've tried using the Anaconda package via conda install -c conda-forge pymc3 and in a virtualenv using only pip as per the documentation. It seems to install ok, but fails when running an…
Peter Coghill
  • 381
  • 2
  • 13
0
votes
1 answer

Theano custom Op for PyMC3

I tried to implement a custom Op to which I get the "Bad input argument to theano function" error. Here is the code. The problem as I understand is: how to convert the PyMC3 variables into theano understandable type? import numpy as np import…
anildadj
  • 11
  • 4