参数说明
计算中所涉及到的说明见下图:
图1 参数说明
计算公式
计算中用到的相关公式罗列如下:
例题
通过下图例题实现结论不确定性合成:
图2 例题
计算流程
(1)计算
(2)计算
(3)计算
(4)计算
(5)计算
(6)计算
代码实现
PE1 = PE2 = PE3 = 0.6
PHs = [0.091, 0.01]
PExSs = [0.84, 0.68, 0.36]
LSs = [2, 100, 200, 50]
LNs = [0.00001, 0.0001, 0.001, 0.1]
def PLS(LS, PH):
PHxLS = (LS*PH)/((LS-1)*PH+1)
return PHxLS
def PHS(PH, PE, PHxE, PExS):
if 0 < PExS < PE:
PHxS = PHxE + (PH-PHxE)/PE*(PExS)
elif PE <= PExS <= 1:
PHxS = PH + (PHxE-PH)/(1-PE)*(PExS-PE)
return PHxS
def OHS(PHxS):
OHxS = PHxS/(1-PHxS)
return OHxS
print('(1)计算O(H1|S1)')
PH1xE1 = PLS(LSs[0], PHs[0])
PH1xS1 = PHS(PHs[0], PE1, PH1xE1, PExSs[0])
OH1xS1 = OHS(PH1xS1)
print('P(H1|E1):', PH1xE1, '\nP(H1|S1):', PH1xS1, '\nO(H1|S1):', OH1xS1)
print('(2)计算O(H1|S2)')
PH1xE2 = PLS(LSs[1], PHs[0])
PH1xS2 = PHS(PHs[0], PE2, PH1xE2, PExSs[1])
OH1xS2 = OHS(PH1xS2)
print('P(H1|E2):', PH1xE2, '\nP(H1|S2):', PH1xS2, '\nO(H1|S2):', OH1xS2)
print('(3)计算P(H1|S1,S2)')
OH1 = OHS(PHs[0])
OH1xS1S2 = (OH1xS1/OH1)*(OH1xS2/OH1)*OH1
PH1xS1S2 = OH1xS1S2/(1+OH1xS1S2)
print('O(H1):', OH1, '\nO(H1|S1,S2):', OH1xS1S2, '\nP(H1|S1,S2):', PH1xS1S2)
print('(4)计算O(H2|S1,S2)')
PH2xH1 = PLS(LSs[3], PHs[1])
PH2xS1S2 = PHS(PHs[1], PHs[0], PH2xH1, PH1xS1S2)
OH2xS1S2 = OHS(PH2xS1S2)
print('P(H2|H1):', PH2xH1, '\nP(H2|S1,S2):', PH2xS1S2, '\nO(H1|S1,S2):', OH2xS1S2)
print('(5)计算O(H2|S3)')
PH2x0E3 = PLS(LNs[2], PHs[1])
PH2xS3 = PHS(PHs[1], PE3, PH2x0E3, PExSs[2])
OH2xS3 = OHS(PH2xS3)
print('P(H2|非E3):', PH2x0E3, '\nP(H2|S3):', PH2xS3, '\nO(H2|S3):', OH2xS3)
print('(6)计算P(H1|S1,S2,S3)')
OH2 = OHS(PHs[1])
OH2xS1S2S3 = (OH2xS1S2/OH2)*(OH2xS3/OH2)*OH2
PH2xS1S2S3 = OH2xS1S2S3/(1+OH2xS1S2S3)
print('O(H2):', OH2, '\nO(H1|S1,S2,S3):', OH2xS1S2S3, '\nP(H1|S1,S2,S3):', PH2xS1S2S3)
求解结果
图3 求解结果