1

我想使用 pymc3 进行贝叶斯分析。我的一个参数具有 Beta 分布,a=28.78, b=0.98, loc=-0.22, scale= 0.32。有谁知道如何在 pymc3 模型中定义 4 参数 Beta 分布?就像是:

with pm.Model() as model_g:
    n=pm.Beta(‘n’, 28.78, 0.98, -0.22, 0.32)
4

1 回答 1

0

这是一个确定性变换:

import pymc3 as pm

theta_a = 28.78
theta_b = 0.98
theta_loc = -0.22
theta_scale = 0.32

with pm.Model() as model_g:
  n_raw = pm.Beta('n_raw', theta_a, theta_b)
  n = pm.Deterministic('n', theta_scale * n_raw + theta_loc)
于 2021-12-13T22:56:17.837 回答