Questions tagged [pymc]

PyMc is a Python module for providing Bayesian statistical models, algorithms and estimations. Two versions are currently widely used: 2 and 3, that are significantly different. Version 2 is not supported anymore, but version 3 is not fully compatible with previous codes and translating a V2-code to V3 is not always straightforward. If you have a PyMc question specific to V3, consider using the [pymc3] tag in addition to the [pymc] tag.

Pymc is a Python module for providing Bayesian statistical models and algorithms. It requires Numpy. PyMC includes methods for summarizing output, plotting, goodness-of-fit and convergence diagnostics.

According to its documentation, Pymc's notable features include:

  • Bayesian statistical models with Markov chain Monte Carlo and other algorithms.
  • A suite of statistical distributions.
  • A module for modeling Gaussian processes.
  • Creates summaries including tables and plots.
  • Extensible

Source: https://github.com/pymc-devs/pymc
Pypi: https://pypi.python.org/pypi/pymc
Docs: http://pymc-devs.github.io/pymc/

511 questions
41
votes
7 answers

Highest Posterior Density Region and Central Credible Region

Given a posterior p(Θ|D) over some parameters Θ, one can define the following: Highest Posterior Density Region: The Highest Posterior Density Region is the set of most probable values of Θ that, in total, constitute 100(1-α) % of the posterior…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
35
votes
4 answers

Install anaconda library from a local source

I have been trying to install pymc for some time on a Windows PC behind a very complicated proxy; effectively making this an installation on a computer not connected to the internet. I have tried - unsuccessfully - to set a proxy in the condarc file…
Noel Evans
  • 8,113
  • 8
  • 48
  • 58
32
votes
7 answers

Import a module with parameter in python

Is it possible to import a module with some parameter in python ? All I mean by parameter is that there exists a variable in the module which is not initialized in that module, still I am using that variable in that module. In short, I want behavior…
turing
  • 577
  • 1
  • 4
  • 12
31
votes
2 answers

Pyro vs Pymc? What are the difference between these Probabilistic Programming frameworks?

I used 'Anglican' which is based on Clojure, and I think that is not good for me. Bad documents and a too small community to find help. Also, I still can't get familiar with the Scheme-based languages. So I want to change the language to something…
MinKi Jo
  • 457
  • 1
  • 5
  • 10
29
votes
1 answer

PyMC: Taking advantage of sparse model structure in Adaptive Metropolis MCMC

I have a model that is structured as in this diagram: I have a population of several people (indexed 1...5 in this picture). Population parameters (A and B, but there can be more) determine the distributions for each individual's latent variable…
Danny
  • 450
  • 4
  • 10
29
votes
2 answers

Fit a non-linear function to data/observations with pyMCMC/pyMC

I am trying to fit some data with a Gaussian (and more complex) function(s). I have created a small example below. My first question is, am I doing it right? My second question is, how do I add an error in the x-direction, i.e. in the x-position…
Magnus Persson
  • 823
  • 1
  • 7
  • 22
27
votes
3 answers

FloatingPointError from PyMC in sampling from a Dirichlet distribution

After being unsuccessful in using decorators to define the stochastic object of the "logarithm of an exponential random variable", I decided to manually write the code for this new distribution using pymc.stochastic_from_dist. The model that I am…
Cupitor
  • 11,007
  • 19
  • 65
  • 91
21
votes
1 answer

How does pymc represent the prior distribution and likelihood function?

If pymc implements the Metropolis-Hastings algorithm to come up with samples from the posterior density over the parameters of interest, then in order to decide whether to move to the next state in the markov chain it must be able to evaluate…
user18297
  • 323
  • 2
  • 7
15
votes
1 answer

Anaconda - UnsatisfiableError: The following specifications were found to be in conflict

When I was trying to install a module 'pymc' through anaconda environments, it showed the error message as follows: UnsatisfiableError: The following specifications were found to be in conflict: blaze -> pyyaml -> python[version='>=2.7,<2.8.0a0']…
qismees
  • 153
  • 1
  • 1
  • 4
15
votes
2 answers

How can I make a discrete state Markov model with pymc?

I am trying to figure out how to properly make a discrete state Markov chain model with pymc. As an example (view in nbviewer), lets make a chain of length T=10 where the Markov state is binary, the initial state distribution is [0.2, 0.8] and that…
shpigi
  • 185
  • 2
  • 8
14
votes
1 answer

Fit two normal distributions (histograms) with MCMC using pymc?

I am trying to fit line profiles as detected with a spectrograph on a CCD. For ease of consideration, I have included a demonstration that, if solved, is very similar to the one I actually want to solve. I've looked at this:…
JBWhitmore
  • 11,576
  • 10
  • 38
  • 52
13
votes
1 answer

how to speed up PyMC markov model?

Is there a way to speed up this simple PyMC model? On 20-40 data points, it takes ~5-11 seconds to fit. import pymc import time import numpy as np from collections import OrderedDict # prior probability of rain p_rain = 0.5 variables =…
yyk
  • 681
  • 1
  • 5
  • 8
11
votes
3 answers

Creating a three-level logistic regression model in pymc3

I'm attempting to create a three-level logistic regression model in pymc3. There is a top level, mid level, and an individual level, where the mid-level coefficients are estimated from top-level coefficients. I'm having difficulty specifying the…
vbox
  • 384
  • 2
  • 10
11
votes
2 answers

pymc3 : Multiple observed values

I have some observational data for which I would like to estimate parameters, and I thought it would be a good opportunity to try out PYMC3. My data is structured as a series of records. Each record contains a pair of observations that relate to…
sozen
  • 125
  • 1
  • 5
11
votes
2 answers

Parallelization of PyMC

Could someone give some general instructions on how one can parallelize the PyMC MCMC code. I am trying to run LASSO regression following the example given here. I read somewhere that parallel sampling is done by default, but do I still need to use…
cmlakhan
  • 127
  • 1
  • 7
1
2 3
34 35