官术网_书友最值得收藏!

Flipping coins the PyMC3 way

Let's revisit the coin-flipping problem from Chapter 1, Thinking Probabilistically, but this time using PyMC3. We will use the same synthetic data we used in that chapter. Since we are generating the data, we know the true value of , called theta_real, in the following code. Of course, for a real dataset, we will not have this knowledge:

np.random.seed(123)
trials = 4
theta_real = 0.35 # unknown value in a real experiment
data = stats.bernoulli.rvs(p=theta_real, size=trials)
主站蜘蛛池模板: 铜山县| 抚顺县| 澳门| 永嘉县| 肇东市| 宁河县| 万宁市| 陇西县| 台州市| 始兴县| 沁水县| 永春县| 威远县| 师宗县| 祥云县| 周至县| 新津县| 佛坪县| 峨山| 建德市| 登封市| 柳江县| 增城市| 徐闻县| 沂南县| 博罗县| 克拉玛依市| 五大连池市| 金山区| 徐汇区| 杨浦区| 弥勒县| 新竹县| 禹城市| 开化县| 措美县| 赣榆县| 阳东县| 玛多县| 南投县| 黑龙江省|