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
0 answers

AttributeError: module 'theano' has no attribute 'compile'

I am using Windows 10, python 3.4, Anaconda distribution and getting this error when importing PyMC3 or Theano. Quick google search did not return anything useful... Anyone has any idea what's going on and how to fix it? Thanks in advance! import…
Polina
  • 33
  • 1
  • 8
0
votes
1 answer

pymc3: using NUTS

I want to have a fair comparison between different mcmc methods, particularly, I want to compare the sampling performance of my method with NUTS. However, I think the sampling function in pymc3 has lots of settings/tuning which improve the…
KiaSh
  • 147
  • 1
  • 6
0
votes
0 answers

Wishart distribution in pymc3

I am doing a Bayesian analysis with pymc3 (a graphic model with a lot of priors) as below: import pymc3 as pm import theano.tensor as T with pm.Model() as smk: a_u = pm.InverseGamma('a_u',alpha=2*np.ones(L),beta=1/A_u**2,shape=L) sigma2_u =…
0
votes
0 answers

How to use array of distributions as argument for new distribution in pymc3

I'm trying to model following problem: Before some switching point in time (chosen from DiscreteUniform distribution), values are chosen from Uniform distribution with bounds early_low, early_high. After this switch in time, values are chosen from…
user224348
  • 200
  • 1
  • 7
0
votes
1 answer

Parameters for fitted distribution

When searching for the best-fit distribution for my dataset, the result was the Exponentially Modified Normal distribution with the following parameters: K=10.84, loc=154.35, scale=73.82 Scipy gives us a way to analyze the mean of the…
Adam Schroeder
  • 748
  • 2
  • 9
  • 23
0
votes
0 answers

How to build the MMSB model with pymc3?

Here is the model I want to describe in pymc3. I wrote the following codes, but they do not work. with pm.Model() as model: bernoulli_parameters = np.empty([N, N], dtype=object) for n in range(N): for m in range(N): …
Da_Yi
  • 1
  • 1
0
votes
0 answers

PyMC3 hangs after completing NUTS sampling

I have a model that seems to run smoothly. I initialize my nuts sampler with a metropolis sample, and the metropolis sample completes without trouble. It then moves into the nuts sampler, completes all iterations, but then hangs. I have tried:…
Reen
  • 399
  • 1
  • 5
  • 12
0
votes
1 answer

how to calculate log posterior of a GP over a trace in pymc3

Use case Suppose I have an observation y_0 at X_0 which I'd like to model with a Gaussian process with hyper params theta. Suppose I then determine a distribution in the hyper params theta by hierarchically sampling the posterior. Now, I'd like to…
Josh Albert
  • 1,064
  • 13
  • 16
0
votes
0 answers

pymc3 on windows10/cygwin64/python3.6 core dumps at import statement

Any thoughts on what to try when installation of pymc3, using pip, works flawlessly, but as soon as the statement import pymc3 is executed, Python3.6 coredumps ? $ python3.6 Python 3.6.1 (default, Mar 21 2017, 21:49:16) [GCC 5.4.0] on cygwin Type…
Pryderide
  • 153
  • 1
  • 10
0
votes
1 answer

Using UniformDiscrete and DensityDist for Mixture distribution throws IndexError: axis 1 is out of bounds [-1, 1)

I have the following model in which it uses Jeffrey's prior for Geometric distribution for one of the distributions. I have one of the distributions that is derived from the others and uses that in Mixture distribution. I am getting IndexError:…
manjula
  • 35
  • 7
0
votes
3 answers

Acceptance-rate in PyMC3 (Metropolis-Hastings)

Does anyone know how I can see the final acceptance-rate in PyMC3 (Metropolis-Hastings) ? Or in general, how can I see all the information that pymc3.sample() returns ? Thanks
KiaSh
  • 147
  • 1
  • 6
0
votes
1 answer

Could someone explain more clear "programming" part of probabilistic programming?

Usually in the docs for probabilistic programming frameworks I can read much about MCMC but not very much about programming. Every example I see have usually only very short and simple probabilistic program. Usually they are about 5-10 lines of…
RedRus
  • 118
  • 6
0
votes
0 answers

How to mix point-estimate with Bayesian estimate in pymc3?

Suppose I have a simple model, y=a*x+b I want to model a =pymc3.Normal('a',mu=0,sd=1.,shape=(1)), a normal distribution, and I want to make b as an unknown constant. Then how to assign a pymc3 object to b? Thank you.
hadesmajesty
  • 51
  • 2
  • 6
0
votes
1 answer

How to use a list of indices to partition a list of observed in PyMC3?

I have a list of observed data score and a list of indices ind. Every element of ind is either 0, 1, or 2. score and ind have the same length, and ind partitions score into three sets: if ind[i] is k, then score[i] is in set k. I would like to fit…
David Bridgeland
  • 525
  • 1
  • 9
  • 16
0
votes
1 answer

PyMC3 performance issues with No U-Turn Sampler (NUTS): less than 2 iterations per second with simple model

I am trying to understand what is the problem with the following code: import pymc3 as pm import theano as t X = t.shared(train_new) features = list(map(str, range(train_new.shape[1]))) with pm.Model() as logistic_model: glm = pm.glm.GLM(X,…
rubik
  • 8,814
  • 9
  • 58
  • 88