资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2012-2-27,#,参数估计假设检验,2022/9/29,谢中华,MATLAB,从零到进阶,.,天 津 科 技 大 学 数 学 系 谢中华,MATLAB,从零到进阶,参数估计与假设检验,主要内容,常见分布的参数估计,正态总体参数的检验,第二节 常见分布的参数估计,一、分布参数估计的,MATLAB,函数,x=15.14,14.81,15.11,15.26,15.08,15.17,15.12,14.95,15.05,14.87;,muhat,sigmahat,muci,sigmaci=normfit(x,0.1),mu_sigma,mu_sigma_ci=mle(x,distribution,norm,alpha,0.1),x=0.7917,0.8448,0.9802,0.8481,0.7627,0.9013,0.9037,0.7399,0.7843,0.8424,0.9842,0.7134,0.9959,0.6444,0.8362,0.7651,0.9341,0.6515,0.7956,0.8733;,PdfFun=(x,theta)theta*x.(theta-1).*(x0,phat,pci=mle(x(:),pdf,PdfFun,start,1),x=normrnd(10,4,100,1);,phat,pci=mle(x),phat,pci=mle(x,distribution,normal),phat,pci=mle(x,pdf,normpdf,start,0,1),phat,pci=mle(x,cdf,normcdf,start,0,1),【,例,18.2-3,】,调用,normrnd,函数生成,100,个服从均值为,10,,标准差为,4,的正态分布的随机数,然后调用,mle,函数求均值和标准差的最大似然估计。,phat=mle(data),phat,pci=mle(data),.=mle(data,distribution,dist),.=mle(data,.,name1,val1,name2,val2,.),.=mle(data,pdf,pdf,cdf,cdf,start,start,.),.=mle(data,logpdf,logpdf,logsf,logsf,start,start,.),.=mle(data,nloglf,nloglf,start,start,.),补充:,mle,函数的调用格式:,第三节 正态总体参数的检验,一、总体标准差已知时的单个正态总体均值的,U,检验,调用格式:,h=ztest(x,m,sigma),h=ztest(.,alpha),h=ztest(.,alpha,tail),h=ztest(.,alpha,tail,dim),h,p=ztest(.),h,p,ci=ztest(.),h,p,ci,zval=ztest(.),ztest,函数,x=97 102 105 112 99 103 102 94 100 95 105 98 102 100 103;,h,p,muci,zval=ztest(x,100,2,0.05),h,p,muci,zval=ztest(x,100,2,0.05,right),二、总体标准差未知时的单个正态总体均值的,t,检验,调用格式:,h=ttest(x),h=ttest(x,m),h=ttest(x,y),h=ttest(.,alpha),h=ttest(.,alpha,tail),h=ttest(.,alpha,tail,dim),h,p=ttest(.),h,p,ci=ttest(.),h,p,ci,stats=ttest(.),t,test,函数,x=49.4 50.5 50.7 51.7 49.8 47.9 49.2 51.4 48.9;,h,p,muci,stats=ttest(x,50,0.05),三、总体标准差未知时的两个正态总体均值的比较,t,检验,调用格式:,h=ttest2(x,y),h=ttest2(x,y,alpha),h=ttest2(x,y,alpha,tail),h=ttest2(x,y,alpha,tail,vartype),h=ttest2(x,y,alpha,tail,vartype,dim),h,p=ttest2(.),h,p,ci=ttest2(.),h,p,ci,stats=ttest2(.),t,test,2,函数,x=20.1,20.0,19.3,20.6,20.2,19.9,20.0,19.9,19.1,19.9;,y=18.6,19.1,20.0,20.0,20.0,19.7,19.9,19.6,20.2;,alpha=0.05;,tail=both;,vartype=equal;,h,p,muci,stats=ttest2(x,y,alpha,tail,vartype),四、总体均值未知时的单个正态总体方差的卡方检验,调用格式:,H=vartest(X,V),H=vartest(X,V,alpha),H=vartest(X,V,alpha,tail),H,P=vartest(.),H,P,CI=vartest(.),H,P,CI,STATS=vartest(.),.=vartest(X,V,alpha,tail,dim),var,test,函数,x=49.4 50.5 50.7 51.7 49.8 47.9 49.2 51.4 48.9;,var0=1.5;,alpha=0.05;,tail=both;,h,p,varci,stats=vartest(x,var0,alpha,tail),五、总体均值未知时的两个正态总体方差的比较,F,检验,调用格式:,H=vartest2(X,Y),H=vartest2(X,Y,alpha),H=vartest2(X,Y,alpha,tail),H,P=vartest2(.),H,P,CI=vartest2(.),H,P,CI,STATS=vartest2(.),.=vartest2(X,Y,alpha,tail,dim),var,test,2,函数,x=20.1,20.0,19.3,20.6,20.2,19.9,20.0,19.9,19.1,19.9;,y=18.6,19.1,20.0,20.0,20.0,19.7,19.9,19.6,20.2;,alpha=0.05;,tail=both;,h,p,varci,stats=vartest2(x,y,alpha,tail),
展开阅读全文