1、贝叶斯统计大部分课后习题答案贝叶斯统计大部分课后习题答案习题讲解 一、1,3,5,6,10,11,12,15 1.1记样本为x. 226pxC(0.1)*0.1*0.90.1488,8226pxC(0.2)*0.2*0.80.2936,8后验分布:0.1488*0.7,0.10.5418x,,0.1488*0.70.2936*0.3,0.2936*0.3,0.20.4582x,,0.1488*0.70.2936*0.3,111233536mxpxdCdd,(|)(1)*2(1)112(1),,8,00015 px(|),,36,x840(1),01,,mx,1.6 1.11 由题意设x表示等候
2、汽车的时间,则其服从均匀分布 U(0,),1,0,x,px(), ,0,其它,Xxxx,(,)因为抽取3个样本,即,所以样本联合分布为 1231,0,xxx,1233 ,pX(),其它0,4,192/,4, 又因为 (),0,4,所以,利用样本信息得 1192192,hXpXxxx(,)()() (8,0,) 123347,,,,,192,mXhXdd()(,)于是 7,88,的后验分布为 76hX(,)192/68,, ()X,7,,192mX(),d,78,6,68,,8,7 ()X,0,8,1.12样本联合分布为: 1pxx,(),0n, ,,1,/,00(),0,0 ,,nn11 ,(
3、)()()/1/,max,xpxxx,0101n,,n1,因此的后验分布的核为,仍表现为Pareto分布密度函数的核 1/,,nn1,()/,,,n11即 ()x,0,1即得证。 1.15 n,xi,nnnx,1i1()样本的似然函数:pxee,,,1,(),e, ,,,nnx,,,1(),参数的后验分布()()()xpxe,服从伽马分布Gannx,,.,,0.0002,(2)4,20000., ,2,0.00012,二、1,2,3,5,6,7,8,10,11,12 ,t2.2 解: 由题意,变量t服从指数分布: pte(),tni,pTe(),样本联合分布 ,1,(,),0Gae,且 , E
4、()0.2,Var()1,(),由伽玛分布性质知: ,0.2,0.04,0.2, ,12,t,3.8 又已知 n=20, nnt,,,203.876nt,,,,20.04,76.2 ,所以 ,ii,1,1ii由于伽玛分布是指数分布参数的共轭先验分布,而且后验分布 ,,,tt(),nn,,,11,ii ()()()tpTeee,即后验分布为 GantGa(,)(20.04,76.2),,,i,,n20.04,|TE()0.263, ,,t76.2,i,1服从倒伽玛分布 ,IGantIGa(,)(20.04,76.2),,,i,,t,i,|1TT, ()()4.002EE,1,,n,11,2.3可
5、以算出的后验分布为,的后验期望估计的后验方差为. Ga(11,4)16n,362.5 . ,,1,/,00,2.7的先验分布为: (),0,0令 ,max,xx,101n,,nn1,()/,,,n11可得后验分布为: ()x,0,1(),n,1,Ex(),则的后验期望估计为:, ,n,,1,2(),,n1Varx(),后验方差为:. ,2(1)(2)nn,,,,n1,xGaIGa(,),(,)2.8由可以得出 22,n12()1n,x,1,22,2 pxxex,(),0,n,()2,(1),,,(),0,e ,(),(1)的后验分布为: x,2,n,,(1),22,()()()xpxe, nx
6、IGa(,),,即为倒伽玛分布的核。 22nxIGa(,),,所以的后验分布为 22x,,x2,,2(2)后验均值为 Ex(),nn22,,1,,2x2(),,2后验方差为 Varx(),nn2(1)(2),,,,22(3)样本分布函数为: nnn,1,n,xnn2i,1(2),2,12i pxpxxe()(),ii,n(/2),11ii,,,所以的后验分布为: nx,2,i,2ni,1,,(1),22,()()()xpxe, nx,2in,1i即为的核。 (,),,IGa22n1n21(),n,xni,1,2,,(1)n,2,1i2, (xpxxee,)()()*,i,n,(),1i,()2
7、(dx,)令 ,0d,即:nnnn1xx,22,ii,222x,2,()nnn,2i,11iin,121,n,ni,1222222,xee,,,(1)*0,i2,n,()22,i,1,()2nxn,i,1i,2,x,,i,12i可得 ,MD22n,22n,,1,2nxn,i,1i,2,x,,i,12i而由公式得 ,E22n,,22n,,,1,2因此,倒伽玛分布的这两个估计是不一样的,原因是它不对称。 2.10解:已知 xNN(,1),(3,1),2N(,),设的后验分布为 11可得: ,22,x,,0, ,122,,,0111 ,,222,102,243,,12x,3由已知得:, ,03n33
8、33111,2,?,3, 1131134,,所以的95,的可信区间为: 30.51.96,30.51.96,,即为. 2.02,3.98222.11已知xNIGa0, ,nn1,22,可得的后验分布为IGax,, ,i,22i,1,n12,,x,i2i,1后验均值为:, ,En,,1,22n,12,x,,i,2,i12,后验方差为: Varx,,2nn,,,,,12,22,变换: n11n,2,Gax, ,i,222,1,in1,n,,22,22,x ,i,2,2,1,i,n,1,22令: Pxn,220.9,,,,,,0.1i,2,1,i,n22,,x,i2,i1可得的0.9可信上限为. ,
9、2n,2,,0.1,,1,/,00,2.12的先验分布为: (),0,0令 ,max,xx,101n,,nn1,()/,,,n11可得后验分布为: ()x,0,1,1,设的可信上限为, U,U则 ,xd,1,,1带入有: ,U,nn1,()/1,,,nd1,1,n,1 ,,n,U1,n1,U1,三、10,11,12,13 3.10解:依题意1x,pxxexp,0,,,0.01,20.01exp,0,,,,,0.01x,,3则mxpxdd0.01exp, ,,0,0.01,0x,2x0.01,该元件在时间之前失效的概率200:2002000.01pmxdxdx0.99995,,2,00x0.01
10、,3.11:解依题意xi,iipxe,,iix!i,1,i,e,0,,iii,,,xi,,,1i ii,mxpxdeed,,iiiiiii,0x,!,i,,x,ix,i,,x1!,i,nnn,,x,,i,mxmx,,,ix,i,ii,11,,x1!,,i,3.12解:超参数和的似然函数为,333,3,,,,,,xf35,,iL,其中,,338383x,,i1i,720,1!13!5!1x,,,,i,,222f,,1234.,,由,L,,,0,L,,,0,38,,1,ff,3ln,,从而有:,38,ff,3ln,,3,3,利用软件计算,可得,,1.033599=0.3875996,83.13证明
11、:泊松分布的期望和方差分别为2,.,,,1,,=,0,e,,,,,,,,ed,m,0,,,x,22,,,EE,,221,2,2,,,,,,EE,m,22,,2,,,,m2,利用样本矩代替边际分布的矩,列出如下方程:,x,2,,S2,2 ,x,2,Sx,x,2,Sx,四、1,4,8,9,10,11,12,15,16 4.4 15,6,7,8,9,10,5,6,7,8,9,10状态集行动集,,,2收益函数,5,10aa,Qa,,,6,5,aa,收益矩阵aaaaaa123456252423222120,1,2530292827262,2530353433323,Q,2530354039384,253
12、0354045445,253035404550,6,3根据定义可知,最优a5行动是,即采摘朵鲜花,14按折中准则:,HQaQa,,,max,1min,,,H,25,,,1,H,,246,,2,H,,2312,3,H,,2218,4, ,H,,2124,5,H,,2030,6,1当时,选择,每天摘朵鲜花05,a1,61当时,选择,每天摘朵鲜花,110a.6,64.8 La,1500,13购买8件. 4.9 a对于行动,其收益函数为 1100,00.1, Q,30,0.10.2,,50,0.21,a对于行动,其收益函数为 2Q,40,01,从而可得在a和a处的损失函数: 120,00.1, La,
13、10,0.10.2,,,1,90,0.21,60,00.1,La, ,,,20,0.11,服从 Be2,14,0.21 Lapdpd,,,109018.86,元吨,1,0.10.20.1 Lapd,6027.06,元吨,2,0故采用第一种收费方法对工厂有利. #附R软件计算定积分程序: int-function(x)210*x*(1-x)13; integrate(int,0.1,0.2)$value*10+integrate(int,0.2,1)$value*90; 1 18.86049 integrate(int,0,0.1)$value*60; 1 27.05742 4.10 18201
14、2256,,,,0,6,QaQaaa当时,则在和处的损失函数为,,1212La,0,,,1La,305,,2,6,QaQaaa当时,则在和处的损失函数为,1212,La,530,,1,La,0,,2,0,10服从上的均匀分布,,101Lad,5304,1,610,61Lad,3059,2,010,a.最优行动是1 五、2,3,7,11,18,21,22 5.2(2)2x,,,12(4) 由可得xNpxe,1,2,n2x,,i,ni1,1,2,样本的似然函数为:pXe,,,2,2nx,,,n2后验分布xe,,,2, 2,ncnx,,,,n2,lned,clnEex,,cn1,则dx,,lnBcn
15、cc222,c,,x2n附:用R软件作图程序: y-function(x)exp(0.1*x)-0.1*x-1; plot(y,xlim=c(-20,20),type=l,lty=1); lines(x,exp(0.5*x)-0.5*x-1,xlim=c(-20,20),type=l,lty=2); lines(x,exp(1.2*x)-1.2*x-1,xlim=c(-20,20),type=l,lty=3); leg.names1,,,B,,n2,若0,1,考虑后验风险,21,,,na,1,,,n,1,Raxd,01,,,0,,,n1,,111,,n,,,,,,nnn222,122,,,,,
16、dadad1211,,000,,,n,,0xn,1,ax,,B,,,n2,若01,ax1.,,B5.18(1) 支付矩阵aa 12,10075,1W,100150,2损失矩阵aa 12,250,1L,050,2,aaaELaELa,17.5,15,,与下的先验期望损失为,故是最优行动,12212,先验. EVPI,15元,(2) 从到上的任一个映射都是该问题的决策函数0,1,2,aax,.,,12(3)、(4) 2xbmxpx2,边缘概率可得:,,,ii ,i1mmm00.87475,10.1205,20.00475,后验分布为:,X 0 1 2 0.7222 0.5519 0.3684 ,=
17、0.05 10.2778 0.4481 0.6316 ,=0.1 2,x计算ELa,,可得表格: ,X 0 1 2 ,x18.055 13.7975 9.21 ELa,, ,1,,x13.89 22.405 31.58 ELa,,,2,从而最优决策函数为: ax,0,2, ,x,,,ax,1,2,1,xx,,EVPIEELx,13.89*0.8747513.7975*0.12059.21*0.0047513.8566后验,,,,xx,,,EVSIEVPIEELx,先验元,1513.85661.1434,,,ENGSEVSIC,21.14340.20.9434元,5.21 bb,21(1) ,6
18、,0mm,212,10,4,10,NEmma,最优行动为,122tmm,5,4,10,6,120,0DLDL,1,10.08332,00NN,EVPILDt,*0.08332*5*41.6664,0N,(2) 类似可得,0,,3*=0.04270*5*3=0.6405EVPILt,N,0,2*=0.008491*5*2=0.08491,EVPILt,N,0,1*=0.000007145*5*1=0.000035725,EVPILt,N,EVPI(3)由上先验中有相当一部分是由于先验分布估计得不够精确引起的,随着标准差的,减小,用来描述状态的先验分布愈精确,增加了先验信息,从而减少了先验完全信息及其期望值。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1