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

Posterior Predictive Check on PyMC3 Deterministic Variable

TL; DR What's the right way to do posterior predictive checks on pm.Deterministic variables that take stochastics (rendering the deterministic also stochastic) as input? Too Short; Didn't Understand Say we have a pymc3 model like this: import pymc3…
azane
  • 73
  • 5
0
votes
1 answer

PyMC3: How to use pymc3.traceplot() to overlap means on traceplot

There is a function pymc3.traceplot() that plots the traceplots of the sampling process. I see that the function takes an argument lines that takes a dictionary, in which you can pass the means as lines to be plotted. How would you go about doing…
Nigel Ng
  • 543
  • 1
  • 7
  • 21
0
votes
1 answer

What pymc3 Monte-Carlo stepper can I use for a custom categorical distribution?

I am working on implementing hidden-Markov-Chains in pymc3. I have gotten pretty far in implementing the hidden states. Below, I am showing a simple 2-state Markov-chain: import numpy as np import pymc3 as pm import theano.tensor as tt # Markov…
Helmut Strey
  • 100
  • 8
0
votes
1 answer

failure to adapt pymc2 into pymc3

Can anyone tell me what's wrong in my code below ? I am a casual user of pymc2, generally for solving physical equations. I have troubles to adapt a fit to pymc3 and the documentation seems to me unclear. Also I did not recognize my problem on…
Stéphane
  • 1,389
  • 3
  • 13
  • 34
0
votes
1 answer

Is there a way to generate variables from pymc3?

If I have a model like the one below, how do I access the theano function in order to get the value(s) for my model I'm fitting? This is quite a basic model and so I could just calculate with the raw function for my variables. However, I intend to…
Lucidnonsense
  • 1,195
  • 3
  • 13
  • 35
0
votes
1 answer

Using NUTS sampler for likelihood with matrix exponential

I am trying to infer the generator of a continuous markov process observed at discrete intervals. If the generator of the markov process is $T$, then the stochastic matrix for the discrete time intervals is given by $ P = \exp(T \Delta t)$. To…
nbren12
  • 634
  • 1
  • 7
  • 11
0
votes
0 answers

Is it possible in Stan or PyMC3 to combine 2 multinomial distributions

I have 2 different multinomial distributions that I want to multiply together to get a matrix. This matrix matches my observed data. Is there a way to decompose this data using either PyMC3 or Stan? Are there any good examples? It seems like…
Chris
  • 676
  • 5
  • 20
0
votes
1 answer

Avoiding optimization pitfalls when modeling an ordinal predicted variable in PyMC3

I am trying to model an ordinal predicted variable using PyMC3 based on the approach in chapter 23 of Doing Bayesian Data Analysis. I would like to determine a good starting value using find_MAP, but am receiving an optimization error. The…
Matthew Cox
  • 1,047
  • 10
  • 23
0
votes
0 answers

PyMC3 Simple Topic Model

I'm trying to implement a very simple topic model in PyMC3 and I'm having a problem getting it to sample. I'm pretty sure the issue is in the 'p' function in how I'm trying to access the 'theta' variable. Theta isn't really a list, but I don't…
Chris
  • 676
  • 5
  • 20
0
votes
1 answer

pymc3 theano function usage

I'm trying to define a complex custom likelihood function using pymc3. The likelihood function involves a lot of iteration, and therefore I'm trying to use theano's scan method to define iteration directly within theano. Here's a greatly simplified…
Chris Jones
  • 151
  • 3
0
votes
0 answers

Simple Hidden Markov Model Runs into Possible PyMC3 Limitations

I'm trying to get into language processing, starting with simple HMMs but building out to models that may require discrete parameters (so Stan may not work). Ultimately, I want to process a lot of language data, so need considerable efficiency. …
JasonK
  • 113
  • 7
0
votes
0 answers

Issue executing studentT in PyMC3

I try to execute StudentT() but receive error . Error is "ImportError: ('DLL load failed: The specified procedure could not be found.', '[Elemwise{log1p,no_inplace}()]')" If I use Normal(), there is no issue. from pymc3 import StudentT with…
0
votes
1 answer

How to create a SkewNormal stochastic in pymc3?

How would one use DensityDist to create a SkewNormal distribution for pymc3? There are several dead links to github pages explaining how to create custom Stochastic that are floating around. exp is implemented in theano, but I don't think the Normal…
Marses
  • 1,464
  • 3
  • 23
  • 40
0
votes
2 answers

Simple Hidden Markov Model in PyMC3 throws Theano error

I'm new to PyMC3, Theano, and numpy. Was just trying to duplicate the first 'hidden' Markov Model in the Stan manual--the one in which the states are actually observed. But, I keep running into errors having to do with Theano, numpy, and perhaps…
JasonK
  • 113
  • 7
0
votes
1 answer

IndexError: only integers, slices (`:`), ellipsis (`...`) . .

I am using pymc3 to find a best fit for a 3D surface. This is the code that I am using. with Model() as model: # specify glm and pass in data. The resulting linear model, its likelihood and …
VD97
  • 3
  • 2
  • 6