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

Google colab has some issues related to the Bayesian analysis and corresponding libraries

I am studying the book Bayessian analysis with python and trying to implement all codes in python, for this purpose I use google colab, but when I am running following code from book import arviz import pymc3 as pm import numpy as np from scipy…
user466534
0
votes
1 answer

Use pymc3 variable to set the length of another variable?

Is it possible to use a pymc3 RV to set the shape of another RV? I'm looking to do something along the lines of: with pm.Model() as model: n_obj = pm.Poisson(name='n', mu=5) objs = pm.Uniform(lower=0, upper=1, shape=(n_obj, 2)) When…
kpardo
  • 13
  • 4
0
votes
1 answer

pymc3 - stochastic volatility model with latent AR(1) process

I've been trying to implement and estimate, with pymc3, a basic stochastic volatility (SV) model of the following form: r_t = exp{h_t/2}*e_t h_t = r_0 + r_1*h_{t-1} + n_t where r_t is the return process and h_t the (latent) log-variance process…
jordyril
  • 1
  • 4
0
votes
0 answers

How to simulate normal Bayesian posterior from normal prior in pymc3?

I'm studying Bayesian statistics and I'm trying to estimate the mean of a normal distribution given a normal prior and data which are normally distributed. I have formulas to compute the posterior distribution analitically but I want to solve it by…
0
votes
1 answer

Converting a Pandas Dataframe Cell into a Function Input

I have a Dataframe, df, which contains the probability distributions of different Variables (V1, V2, etc.): distribution parameter_1 parameter_2 parameter_3 V1 Beta 132.0 6775.1 -0.2 V2 Beta 297.4 …
john_mon
  • 487
  • 1
  • 3
  • 13
0
votes
1 answer

Compute probability of parameters given data in a bayesian network with pyMC3

I’m new to pyMC3 and I would like to know if it is possible to use it to solve the following problem: I have a bayesian network (image of my BN: Bayesian network of my problem) and I don’t know the parameters of the distributions of A,B,C,D and S, I…
0
votes
1 answer

Understanding the parameters of pymc3 package

In python's pymc3 package, a typical model building works as follows (imported from…
Bogaso
  • 2,838
  • 3
  • 24
  • 54
0
votes
1 answer

Pip error (cannot import name 'main' from 'pip') after upgrading to python 3.8 (Debian 9)

I needed to upgrade Python to install a package (PyMC3) requiring a version>3.5.4. I installed python 3.8.3 without any problem (installing prerequisite libraries, getting file from official repo with wget,using make altinstall, etc), but when I…
0
votes
1 answer

How to decide on what priors distributions to use for parameters in PyMC3?

I am looking into PyMC3 package where I was interested in implementing the package in a scenario where I have several different signals and each signal has different amplitudes. However, I am stuck on what type of priors I would need to use in…
WDpad159
  • 359
  • 3
  • 15
0
votes
1 answer

Bayesian IRT Pymc3 - Parameter inference

I would like to estimate IRT model using PyMC3. I generated data with the following distribution: alpha_fix = 4 beta_fix = 100 theta= np.random.normal(100,15,1000) prob =…
Pbcacao
  • 35
  • 4
0
votes
1 answer

PyMC3 plots.traceplot in PyCharm

Is there something extra I need to do to show my PyMC3 plots.traceplot results in PyCharm? I just discovered that I need a print() statement around pm.summary(). so I'm wondering if there is another function for the plots. Thank You!
MMB
  • 3
  • 2
0
votes
1 answer

How to get scipy.special functions to take pymc3 RV's as input

I'm trying to use pymc3 to fit a model involving the voigt function (coming from scipy.special). The inputs to the voigt function are supposed to be arrays, whereas a,b are pymc3 classes. How do I get scipy.special functions to take pymc3 RV's as…
Neeraj Kulkarni
  • 355
  • 2
  • 8
0
votes
1 answer

Bayesian update in pymc3: adding more data doesn't work

I am new to pymc3, but I've heard it can be used to build a Bayesian update model. So I tried, without success. My goal was to predict which day of the week a person buys a certain product, based on prior information from a number of customers, as…
user3490622
  • 939
  • 2
  • 11
  • 30
0
votes
0 answers

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(), with pymc3

I have been trying to apli this code to pymc3, but I got ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). I got the error on evaluating the integral, here is the code. import pymc3 as…
0
votes
1 answer

Calculating WAIC for models with multiple likelihood functions with pymc3

I try to predict the outcome of soccer games based on the number of goals scored and I use the following model: with pm.Model() as model: # global model parameters h = pm.Normal('h', mu = mu, tau = tau) sd_a = pm.Gamma('sd_a', .1, .1) …
milanDD
  • 123
  • 1
  • 11