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

Using a complex likelihood in PyMC3

pymc.__version__ = '3.0' theano.__version__ = '0.6.0.dev-RELEASE' I'm trying to use PyMC3 with a complex likelihood function: First question: Is this possible? Here's my attempt using Thomas Wiecki's post as a guide: import numpy as np import…
4
votes
1 answer

Odd correlated posterior traceplots in multilevel model

I'm trying out PyMC3 with a simple multilevel model. When using both fake and real data the traces of the random effect distributions move with each other (see plot below) and appear to be offsets of the same trace. Is this an expected artifact of…
Ben Mabey
  • 1,269
  • 10
  • 18
4
votes
0 answers

PyMC Robust Linear Regression with Measured Uncertainties

I use least squares regression of data with measured errors in both x and y and use the reduced chi-square (mean square weighted deviation: mswd) as a measure of the fit. However, some of the assumptions for using reduced chi-squared likely are not…
srmulcahy
  • 359
  • 1
  • 3
  • 18
3
votes
0 answers

Jetbrains DataSpell managed server doesn't work with the configured python interpreter (a conda environment running theano)

Jetbrains DataSpell looks almost awesome, but I'm having an issue with the managed servers that makes it just alright. I'm using a conda environment (which I've called pymc3_env for obvious reasons) as my interpreter. I've configured both the…
charrison
  • 806
  • 1
  • 7
  • 14
3
votes
0 answers

Theano.scan in hierarchical PyMC3 models

I want to apply theano.scan over multiple parameters in a hierarchical model. The code works great for a single model, however, I'm not sure how to convert the model to a hierarchical model (requiring additional looping). Here is the code for the…
Zach Wolpe
  • 31
  • 1
3
votes
0 answers

Theano TypeError during model building with celerite2 (pymc3)

I recently switched from celerite to celerite2 for modelling stellar light curves. I have followed the celerite 2 tutorial closely, adapting it to my needs. My model consists of a flat mean, a jitter term, a granulation term and an SHO term to model…
3
votes
1 answer

cannot import pymc3 in jupyter lab

I'm new to Python and trying to run someone else's code in Jupyter Lab on my Mac. It requires a package pymc3 that I installed both in Terminal (conda install pymc3) and from Jupyter Lab following these instructions: import sys !conda install --yes…
AFH
  • 665
  • 1
  • 9
  • 28
3
votes
0 answers

Multidimensional PyMC3 Observations

My model has a LogNormal RV, C, of shape (W,D). Each row in W and each column in D has a parameter that is being fit. I have tried to specify my observations as a (W,D) matrix, however, that is leading to a theano compile error raise…
Zachary Luety
  • 305
  • 1
  • 2
  • 8
3
votes
1 answer

TypeError: function() got an unexpected keyword argument 'njobs'

I am working on a basic example of MCMC sampling for Bayesian estimation using PyMC3. I have a minimally working example of my code below: # Establish the parameters of the model p_a = .15 N = 150 n_successes_a = np.random.binomial(N, p_a) # Build…
Ethan
  • 876
  • 8
  • 18
  • 34
3
votes
1 answer

PyMC3, NUTS sampler, what's happening here?

Can someone point me to the docs that will explain what I'm seeing? Pink stuff in a Jupyter notebook makes me think something is wrong. Using PyMC3 (btw, it's an exercise for a class and I have no idea what I'm doing). I plugged in the numbers,…
Vicki B
  • 544
  • 2
  • 9
  • 20
3
votes
1 answer

How can re-train my logistic model using pymc3?

I have a binary classification problem where I have around 15 features. I have chosen these features using some other model. Now I want to perform Bayesian Logistic on these features. My target classes are highly imbalance(minority class is 0.001%)…
Ashok Rayal
  • 405
  • 3
  • 16
3
votes
2 answers

Error when using PyMC3's Exponential function

I have tried below simple code of PyMC3 in Python 3.7 in order to generate lambda value of exponential function. But I am getting below error instead. Could you please let me what the problem is? Code import pymc3 as pm lambda_1 =…
saul
  • 81
  • 10
3
votes
0 answers

model function including a large time loop (PYCM3)

I'm trying to run a baysian calibration of a dynamic model with PYMC3. My model function includes a large time loop, thus when the model is compiled with Theano, the RAM memory exceeds the capacity. For this problem I found how to call the function…
Marty
  • 53
  • 4
3
votes
1 answer

How do I implement maximum likelihood estimation type 2?

I am trying to implement an empirical bayesian ML-II(Maximum likelihood estimation Type II)method for estimating prior distribution parameters from historical data Where: π(θ) is an expression for the prior distribution p(x|θ) is is an expression…
abraxas
  • 45
  • 9
3
votes
0 answers

Difficulty Running Bayesian Gamma Regression with PyMC3

PyMC3 has excellent functionality for dealing with Bayesian regressions, so I've been trying to leverage that to run a Bayesian Gamma Regression using PyMC3 where the likelihood would be Gamma. From what I understand, running any sort of Bayesian…
quant_fin
  • 75
  • 5