小编spn*_*ola的帖子

使用高斯先验的司仪

我试图在使用司仪之前使用高斯,但似乎无法完全弄清楚。基本上我想更换

def lnprior(theta):
     a, b, c = theta
     if 1.0 < a < 2.0 and 1.0 < b < 2.0 and 1.0 < c < 2.0:
        return 0.0
     return -np.inf
Run Code Online (Sandbox Code Playgroud)

使用可以从具有 mu 和 sigma 的高斯分布中采样“a”的东西。我该怎么做?像这样?

def lnprior(theta):
     a, b, c = theta
     if 1.0 < b < 2.0 and 1.0 < c < 2.0:
        return 0.0
     if 0<a<20:
         mu=10
         sigma=1
         s=np.random.normal(mu, sigma)
         return s
     return -np.inf
Run Code Online (Sandbox Code Playgroud)

但这似乎不对?

python statistics bayesian emcee

3
推荐指数
2
解决办法
2815
查看次数

标签 统计

bayesian ×1

emcee ×1

python ×1

statistics ×1