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

Meaning of a variable declaration in PyMC

In this tutorial http://pymc-devs.github.io/pymc/tutorial.html#an-example-statistical-model , disasters = Poisson('disasters', mu=rate, value=disasters_array, observed=True) this line denotes that disasters is a poisson random variable or disasters…
turing
  • 577
  • 1
  • 4
  • 12
0
votes
1 answer

Metropolis Hastings with Custom Log likelihood in Pymc

I want to use pymc to use a MH chain to sample from a custom log likelihood. But I can't seem to get it to work and can't find a decent example online. def getPymcVariable(data): def logp(value): ... return ljps # returns a float def…
tetradeca7tope
  • 491
  • 1
  • 5
  • 7
0
votes
1 answer

I am confused about how to install package 'pymc' into iPython on Mac

I am new to Python and iPython. I have problem installing the package 'pymc' into iPython on Mac. I basically followed these instructions. Here is what I did: First, I downloaded the pymc source file from github, and then I unzipped this under the…
0
votes
2 answers

PyMC: sampling step by step?

I would like to know why the sampler is incredibly slow when sampling step by step. For example, if I run: mcmc = MCMC(model) mcmc.sample(1000) the sampling is fast. However, if I run: mcmc = MCMC(model) for i in arange(1000): …
p.paolo321
  • 193
  • 1
  • 1
  • 7
0
votes
1 answer

PYMC installation --fcompiler not recognized

I'm trying to install pymc on OSX Mountain lion. I have installed gfortran (from http://gcc.gnu.org/wiki/GFortranBinaries#MacOS) and cloned pymc. I tried what has previously been working: 'setup.py config --fcompiler=gfortran build', but this gives…
0
votes
1 answer

Trying to install pymc error: invalid command 'config_fc'

I'm trying to install pymc on osx snow leopard, but I'm getting nowhere. I have installed gfortran. I have pyCharm as IDE. I have cloned the git repo. Running the command 'python setup.py config_fc --fcompiler gnu95 build' It gives me this error:…
Pedro.Alonso
  • 1,007
  • 3
  • 20
  • 41
0
votes
1 answer

Regression with “unidirectional” noise

I would like to estimate the parameters of a simple linear function and a gamma-distributed noise term from data. (Note: This is a follow-up question of https://stats.stackexchange.com/questions/88676/regression-with-unidirectional-noise, but…
frisbee
  • 73
  • 1
  • 6
0
votes
1 answer

Adding measurement errors to pymc model

I have the following model in pymc2: import pymc from scipy.stats import gamma alpha = pymc.Uniform('alpha', 0.01, 2.0) scale = pymc.Uniform('scale', 1.0, 4.0) @pymc.deterministic(plot=False) def beta(scale=scale): return 1.0 /…
Sergio
  • 677
  • 1
  • 10
  • 20
0
votes
1 answer

PyMC change backend after sampling

I have been using PyMC in an analysis of some high energy physics data. It has worked to perfection, the analysis is complete, and we are working on the paper. I have a small problem, however. I ran the sampler with the RAM database backend. The…
jsw
  • 145
  • 1
  • 9
0
votes
1 answer

Getting errors when installing pymc on Linux

When I try to install pymc using easy_install pymc I am getting following errors warning: no files found matching 'README.txt' warning: no files found matching 'INSTALL.txt' warning: no files found matching 'docs/UserGuide.pdf' Could not locate…
user2085779
0
votes
1 answer

PyMC - variance-covariance matrix estimation

I read the following paper(http://www3.stat.sinica.edu.tw/statistica/oldpdf/A10n416.pdf) where they model the variance-covariance matrix Σ as: Σ = diag(S)*R*diag(S) (Equation 1 in the paper) S is the k×1 vector of standard deviations, diag(S) is…
akhil
  • 839
  • 3
  • 8
  • 15
0
votes
1 answer

Mixture of gaussians not converging in pyMC3

I have a mixture of 3 gaussians but no matter how much I tweak the priors I can't get the posterior means to move from their prior values.. k = 3 n1 = 1000 n2 = 1000 n3 = 1000 n = n1+n2+n3 mean1 = 17.3 mean2 = 42.0 mean3 = 31.0 precision =…
Tim
  • 2,134
  • 3
  • 26
  • 40
0
votes
1 answer

Sinusoidal regression in PyMC3

I'm exploring PyMC3 through a regression example. I started with a line and then moved to a quadratic and that worked great. When I tried to move to a sine function with the random variable within it though things went sour. Here's my PyMC3…
Justin Bozonier
  • 7,584
  • 9
  • 44
  • 46
0
votes
1 answer

N-mixture models in Python

I'm new to Python and am having trouble translating a model I wrote in R into Python language. If anyone has any suggestions on resources or code examples that might help I would greatly appreciate it. I've seen some snippets of code and text in…
0
votes
1 answer

Generic Mixture Models in pymc

I have a distribution with multiple humps. I would like to try fitting several different types of distributions to each hump, gaussian, exponential, weibuill, etc. However, as it stands, it seems that I have to manually define a stochastic class for…
archgoon
  • 1,538
  • 2
  • 14
  • 19