PyStan —— 贝叶斯推理的软件包
PyStan 为 Stan 提供了一个 Python 接口,这是一个使用 No-U-Turn 采样器进行贝叶斯推理的软件包,这是Hamiltonian Monte Carlo 的一种变体。 PyStan具有以下依赖项: Python:2.7,> = 3.3 Cython:> = 0.22 NumPy:> = 1.7 PyStan还要求在安装和运行时可以使用C ++编译器。 在基于Debian的系统上,这是通过发出命令apt-get install build-essential来完成的。 例子: importpystan schools_code=""" data{ int<lower=0>J;//numberofschools vector[J]y;//estimatedtreatmenteffects vector<lower=0>[J]sigma;//s.e.ofeffectestimates } parameters{ realmu; real<lower=0>tau; vector[J]eta; } transformed...
