goodness of fit in pymc and plotting discrepancies

这一生的挚爱 提交于 2019-12-02 11:21:47

If you are using the built-in stochastics, there are expval functions that is the expected value for that distribution (in the case of binomial, the function is just binomial_expval, which is just p*n).

In general, I recommend using the gof_plot to produce posterior predictive plots, rather than discrepancy_plot. There are some issues with your code:

  1. Its not clear why you are building a list of prob nodes, rather than just specifying a vector-valued Uniform:

    prob = pymc.Uniform('prob', 0, 1, size=len(Pop))
    
  2. You never need to instantiate Model directly; Just MCMC:

    mc=pymc.MCMC([serobservation,pobservation,prob])
    

With these changes, I get 8 GOF plots, one for each datum. Here is a zip file containing the plots that I got.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!