pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

Unable to Replicate the sampling speed given in the example

Open soumyasahu opened this issue 1 year ago • 3 comments

Hi,

I am very new to pymc. I have mostly used rstan for the bayesian computations required for my research as it is mostly popular for the implementation of the No-U-Turn sampler (NUTS), a popular extension of HMC. Recently we are developing a model which involves Dirichlet Process Mixture (DPM) priors. Implementation of DPM is tricky in stan as it is unable to sample from the discrete parameters. The problem can be solved by marginalizing the likelihood which requires evaluation of the likelihood for each discrete value of the parameters. This makes the sampler very slow.

Recently, I came across pymc4 and found that it can generate from discrete parameters even if they are using NUTS. To understand the usages, I found the following page- https://www.pymc.io/blog/v4_announcement.html

I tried to replicate the examples in the recently installed Anaconda 3 with the jupyter notebook interface. Unfortunately, it is taking 3 hours to run 8000 samples using pymc3 whereas it is supposed to run in 23 seconds as shown on the webpage. Same thing happened using pymc4.

Specs for yy laptop are: Windows 11, 8 cores, ram 16 GB

Please let me know what I should do to replicate the example correctly.

soumyasahu avatar Nov 16 '22 21:11 soumyasahu