python missing_truncated.py
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python missing_truncated.py相关的知识,希望对你有一定的参考价值。
import pymc as pm
import numpy as np
missing_fill_value = 16.172
data = np.array([None, None, None, 12, 17, 20])
#data = np.where(data == np.array(None), missing_fill_value, data)
#masked_values = np.ma.masked_equal(data, value=missing_fill_value)
masked_values = np.ma.masked_array(data, np.equal(data, None), fill_value=10)
mu = pm.Normal('mu', 10, 1e-6, value=10)
tau = pm.Exponential('tau', 0.01, value=10)
x = pm.TruncatedNormal('x', mu=mu, tau=tau, a=7, b=27, value=data, observed=True)
M = pm.MCMC(locals())
M.sample(2000, burn=1000)
mu.summary()
以上是关于python missing_truncated.py的主要内容,如果未能解决你的问题,请参考以下文章
python missing_truncated.py
代写python,代写python编程,python代写,python编程代写,留学生python代写
001--python全栈--基础知识--python安装
Python代写,Python作业代写,代写Python,代做Python
Python开发
Python,python,python