关于人工智能的一题求高手解答啊,要详细步骤

设如下推理规则:
R1:IF E1 THEN(500,0.01) H1
R2:IF E2 THEN(1,100) H1
R3:IF E3 THEN(1000,1) H2
R4:IF E4 THEN(20,1) H2
且已知P(H1)=0.1,P(H2)=0.1,P(H3)=0.1,初始证据的概率为P(E1|S1)=0.5,P(E2|S2)=0,P(E3|S3)=0.8,用主观贝叶斯方法求P(H2|S1,S2,S3)

(1) 由r1计算O(H1| S1)
先把H1的先验概率更新为在E1下的后验概率P(H1| E1)
P(H1|E1)=(LS1×P(H1))/((LS1-1)×P(H1)+1) =(500×0.1)/((500-1)×0.1+1) =0.9823
P(E1|H1)= (LS1-LN1×LS1)/(LS-LN)= 0.9002
P(E1)= P(E1|H1)×P(H1)/ P(H1|E1)= 0.0916
由于P(E1|S1)= 0.5 > P(E1),使用P(H|S)公式的后半部分,后验概率P(H1| S1)和后验几率O(H1|S1)
P(H1|S1)=P(H1)+((P(H1|E1)–P(H1))/(1-P(E1)))×(P(E1|S1)–P(E1))=0.1+(0.9823–0.1)/(1–0.0916))×(0.5-0.0916)=0.1+0.9712×0.4081= 0.4375
O(H1|S1)=P(H1|S1)/(1-P(H1|S1))=0.7778

(2)由r2计算O(H1|S2)
H1在E2下的后验概率P(H1|E2)
P(H1|E2)=(LS2×P(H1))/((LS2-1)×P(H1+1)
=(1×0.1)/((1-1)×0.1+1)
=0.1
P(E2|H1)= (LS2-LN2×LS2)/(LS2-LN2)= 1
P(E2)= P(E2|H1)×P(H1)/ P(H1|E2)= 1

由于P(E2|S2)=0 < P(E2),使用P(H|S)公式的前半部分,得到后验概率P(H1|S2)和后验几率O(H1|S2)
P(H1|S2)=P(H1|~E2)=LN2×O(H1)/(1+LN2×O(H1))
=100×0.1111/12.1
=0.9174
O(H1|S2)=P(H1|S2)/(1-P(H1|S2))=11.1065

(3)计算O(H1|S1,S2)和P(H1|S1,S2)
先将H1的先验概率转换为先验几率
O(H1)=P(H1)/(1-P(H1))=0.1/(1-0.1)=0.1111
再根据合成公式计算H1的后验几率
O(H1|S1,S2)
=(O(H1|S1)/O(H1))×(O(H1|S2)/O(H1))×O(H1)
=(0.7778/0.1111)×(11.1065/0.1111)×0.1111
=77.7555
再将该后验几率转换为后验概率
P(H1|S1,S2)=O(H1|S1,S2)/(1+O(H1|S1,S2))
=0.9873
(4)由r3计算O(H2| S3)
先把H2的先验概率更新为在E3下的后验概率P(H2|E3)
P(H2|E3)=(LS3×P(H2))/((LS3-1)×P(H2)+1)
=(1000×0.1)/((1000-1)×0.1+1)
=0.9911
P(E3|H2)=(LS3-LN3×LS3)/(LS3-LN3)= 0
P(E3)= P(E3|H2)×P(H2)/ P(H2|E3)=0
由于P(E3|S3)=0.8>P(E3),使用P(H|S)公式的后半部分,得到在当前观察S3下的后验概率P(H2|S3)和后验几率O(H2|S3)
P(H2|S3)=P(H2)+((P(H2|E3)–P(H2))/(1-P(E3)))×(P(E3|S3)–P(E3))=0.8129
O(H2|S3)=P(H2|S3)/(1-P(H2|S3))
=4.3447
(5) 由r4计算O(H2| H1)
先把H2的先验概率更新为在H1下的后验概率P(H2|H1)
P(H2|H1)=(LS4×P(H2))/((LS4-1)×P(H2)+1)
=(20×0.1)/((20-1)×0.1+1)
=0.6897
P(H1|H2)=(LS4-LN4×LS4)/(LS4-LN4)= 0
P(H1)= P(H1|H2)×P(H2)/ P(H2|H1)=0

由于P(H1|S1,S2)=0.35040>P(H1),使用P(H|S)公式的后半部分,得到在当前观察S1,S2下H2的后验概率P(H2|S1,S2)和后验几率O(H2|S1,S2)
P(H2|S1,S2)=P(H2)+((P(H2|H1)–P(H2))/(1-P(H1)))×(P(H1|S1,S2)–P(H1))
=0.1+(0.6897–0.1)/(1–0.1)×(0.9873–0.1)
=0.6814
O(H2|S1,S2)=P(H2|S1,S2)/(1-P(H2|S1,S2))
=0.6814/(1-0.6814)=2.1455

(6)计算O(H2|S1,S2,S3)和P(H2|S1,S2,S3)
先将H2的先验概率转换为先验几率
O(H2)=P(H2)/(1-P(H2))=0.1/(1-0.1)=0.1111
再根据合成公式计算H1的后验几率
O(H2|S1,S2,S3)=(O(H2|S1,S2)/O(H2))×(O(H2|S3)/O(H2))×O(H2)
=(2.1455/0.1111)×(4.3447/0.1111)×0.1111
=83.9024
再将该后验几率转换为后验概率
P(H2|S1,S2,S3)=O(H1|S1,S2,S3)/(1+O(H1| S1,S2,S3))
=83.9024/(1+83.9024)=0.9882
可能计算有误,方法应该就是这样的...
温馨提示:答案为网友推荐,仅供参考
相似回答