我正在努力实现一个模型,其中狄利克雷变量的集中因子依赖于另一个变量。
情况如下:
系统由于组件故障而失败(共有三个组件,每次测试/观察时只有一个组件失败)。
组件发生故障的概率取决于温度。
这是该情况的(已注释的)简短实现:
import numpy as np
import pymc3 as pm
import theano.tensor as tt
# Temperature data : 3 cold temperatures and 3 warm temperatures
T_data = np.array([10, 12, 14, 80, 90, 95])
# Data of failures of 3 components : [0,0,1] means component 3 failed
F_data = np.array([[0, 0, 1], \
[0, 0, 1], \
[0, 0, 1], \
[1, 0, 0], \
[1, 0, 0], \
[1, 0, 0]])
n_component = 3
# When temperature …Run Code Online (Sandbox Code Playgroud)