Fork me on GitHub

Python系列文章-pystan贝叶斯推断包使用

目录

  • 背景

  • 第一部分 第一个项目

  • 第二部分 总结

  • 参考文献及资料

背景

概率编程(Probabilistic Programming)使用较多的3个软件包有 Stan、PyMc3、Edward。

Stan 本身就是一种编程语言,用来在生物、物理、工程等领域进行统计建模、数据分析、预测等。下面是官方介绍:

Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation. Thousands of users rely on Stan for statistical modeling, data analysis, and prediction in the social, biological, and physical sciences, engineering, and business.

官网: http://mc-stan.org/

使用手册:https://mc-stan.org/users/documentation/

使用stan进行贝叶斯分析,需要编写stan程序,然后再R或python等调用stan程序,编译为c++程序进行计算。例如在R当中可以使用rstan包来进行计算,非常方便。

第一部分 环境准备

ubuntu环境,使用pip命令直接安装:

1
# pip install pystan

You will also need a C++ compiler such as gcc ≥9.0 or clang ≥10.0.

第二部分

https://people.duke.edu/~ccc14/sta-663/PyStan.html

https://towardsdatascience.com/an-introduction-to-bayesian-inference-in-pystan-c27078e58d53

参考文献及资料

1、官网介绍:https://github.com/stan-dev/pystan

0%