Multivariate Hypergeometric model has very low number of effective samples

I tried thinning the trace, and it apparently worked:

Multiprocess sampling (4 chains in 4 jobs)
CompoundStep
>NUTS: [p]
>Metropolis: [K]
Sampling 4 chains: 100%|██████████| 402000/402000 [02:25<00:00, 2767.98draws/s]
The number of effective samples is smaller than 10% for some parameters.

In[3]: pm.summary(tex1)
Out[3]: 
           mean        sd  mc_error  ...   hpd_97.5         n_eff      Rhat
K__0  38.920828  1.916841  0.039850  ...  42.000000   2504.700201  1.000392
K__1  60.998500  2.055525  0.046910  ...  65.000000   1974.087224  1.000406
K__2  80.080673  2.105018  0.051597  ...  84.000000   2017.003247  1.000479
p__0   0.274843  0.024075  0.000114  ...   0.321911  49930.290211  1.000024
p__1   0.336110  0.025563  0.000137  ...   0.386465  41332.624531  1.000001
p__2   0.389047  0.026263  0.000147  ...   0.439983  43258.001858  1.000029

The trace for fn = 0.9 look OK, and the number of effective samples increase to an acceptable value. It took about 7 times longer to compile because there were 10 times more samples in the trace, but for the toy model it’s still acceptable. I’ll try it with a more realistic model next.

I’ll mark you first answer as the solution, and I’ll post the results with the realistic model when I get to it. Thanks a lot!

3 Likes