PyMC3 and WinBUGS

I am trying to implement a Hierarchical Signal Detection Theory model from Lee and Wagenmakers’ “Bayesian Cognitive Modelling: A Practical Course”.

The code from the book in WinBUGS and my code in pymc3 give very different results. With my pymc3 code parameters mu_d and mu_c stay near zero for both datasets while they should converge to around (2; -1) and (3; 0) respectively. It looks like the chains don’t move much from their initial positions.

I was wondering if this was a problem with WibBUGS->pymc3 translation that I did. Could someone please take a look?

I couldn’t upload the Jupyter notebook I used, so I attached the .py version of it. Also, I couldn’t upload the datasets because new users can only include 2 links.

SDT_2_winbugs.txt (560 Bytes) (1.2 KB)

Bayesian Cognitive Modelling has been ported to pymc3 and you can check out the notebooks here. There are also other books that were ported to pymc3, which you can look up here and here

The particular notebook for signal detection is this one. You can look at the implementation there to see what is being done differently.

1 Like

The datasets:

cond_deduct.csv (320 Bytes)
cond_induct.csv (320 Bytes)

+1 to what @lucianopaz said
In this particular case, Metropolis is not doing a good job at all, this is why your samples are bias/wrong

1 Like