bayesian - pymc3 中均匀分布的区间变换是什么?

标签 bayesian pymc3

我注意到在 pymc3 中使用均匀分布时,采样器还会扫描 _interval参数也是如此,除非指定了转换,例如:

with fitModel6:

    normMu  = pm.Uniform('normMu',lower=0,upper=1000)

不仅会导致对 normMu 进行采样,还会导致对 normMu_interval 进行采样:

trace plot of interval

trace plot of parameter

通常,当我使用统一先验作为尺度参数(如归一化)时,我当然会在对数间隔内进行采样。 pymc3 是否以某种方式为我处理这个问题?

干杯

最佳答案

PyMC3 自动将转换应用于有界变量,以将它们置于不受约束的范围内。每个转换的代码是 here并且在官方 PyMC3 Tutorial 中可以找到有关变量自动转换的非常简短的讨论。 .

编辑

如果链接再次断开/移动,这里是教程中的大部分信息

In order to sample models more efficiently, PyMC3 automatically transforms bounded RVs to be unbounded.

with pm.Model() as model:
    x = pm.Uniform('x', lower=0, upper=1)`

When we look at the RVs of the model, we would expect to find x there, however:

In [16]: model.free_RVs

Out[16]: [x_interval__]

x_interval__ represents x transformed to accept parameter values between -inf and +inf. In the case of an upper and a lower bound, a LogOdds transform is applied. Sampling in this transformed space makes it easier for the sampler...

关于bayesian - pymc3 中均匀分布的区间变换是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34577875/

相关文章:

statistics - 贝叶斯统计、机器学习 : prior v. s 超先验

bayesian - pymc3 中不正确的、平坦的先验

python - 使用分类变量作为 PyMC3 中其他参数的索引

rstanarm 用于二项式实验的贝叶斯分层建模

r - 如何使用 MCMCpack 获得差异的后验?

python - 哪些Python贝叶斯文本分类模块类似于dbacl?

machine-learning - 比较贝叶斯线性回归与线性回归

pymc3 - 在 pymc3 中使用黑盒似然

python - pymc3 SQLite 后端,指定要跟踪的变量列表

python - 使用 PYMC3 进行回归