matlab数理统计例题.doc_第1页
matlab数理统计例题.doc_第2页
matlab数理统计例题.doc_第3页
matlab数理统计例题.doc_第4页
matlab数理统计例题.doc_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1. 求的近似值:对下列图建立计算机模拟模型,并计算的近似值;2+2 =1 1.实验程序Function tlpi% disp ( );Clear;clc;N=input(请输入模拟随机点数:);Mi=0;X=rand(2,n);For i=1:1:n If (x(1,i) 2+x(2,i) 2)=1 Mi=mi+1; End;End ;Disp(strcat(pi=,num2str(4*mi/n);程序运行结果: 请输入模拟随机点数:1000000 Pi=3.14152. 设r.v. XN(0, 1),用计算机来模拟容量n =200 的子样,并画出子样直方图和经验分布函数,并作正态分布的假设检验。程序代码:x = normrnd(0, 1, 1, 200);disp(x);histfit(x);title(r.v. XN(0, 1)的子样, n = 200);% 进行正态分布的假设检验h = jbtest(x);if h = 0 disp(检验结果:接受H0,即认为母体X的分布为正态分布。);else disp(检验结果:拒绝H0,即认为母体X的分布不为正态分布。);end实验结果:Columns 1 through 10 2.6339 1.2481 0.3305 0.1003 -2.1005 1.1459 -0.1459 -0.1483 0.2835 0.0098Columns 11 through 20 1.7760 0.3568 1.0890 -1.2516 0.1421 -0.7580 0.0522 -0.3355 1.4758 0.6184Columns 21 through 30 0.8023 0.4382 -1.2513 0.7503 2.6246 0.8342 0.8570 -0.2754 1.9820 -0.7954Columns 31 through 40 0.6552 -2.7659 -0.9190 -0.3989 1.2394 0.4921 2.0563 -1.5298 0.3965 -0.3391Columns 41 through 50 -0.6528 1.3187 2.0260 -0.2819 -2.3599 -0.6822 1.8487 -0.3284 0.1119 -0.2097Columns 51 through 60 -2.2864 0.3066 1.5574 -0.6595 0.1251 -0.4313 0.7583 2.0325 -1.5039 0.6782Columns 61 through 70 0.2896 -1.0511 0.5099 0.7738 -1.0949 0.0018 -0.2396 -0.5917 2.3150 -0.2251Columns 71 through 80 -0.7033 0.7618 -0.7388 -1.0839 0.9663 1.2635 0.3670 -0.2249 -0.2677 -0.6903Columns 81 through 90 0.4465 0.7429 1.2645 -2.1291 -2.0452 -0.6170 0.1889 -1.1256 -0.4962 0.8256Columns 91 through 100 0.3461 -0.6329 -0.4719 0.3656 2.4809 1.0832 0.8792 0.3220 -0.9326 -1.0902Columns 101 through 110 -1.5519 -1.2675 0.9666 -0.0414 0.2991 -0.4729 -0.8793 -0.1666 -0.2847 0.0671Columns 111 through 120 -0.1349 -0.2205 0.9720 0.0754 -0.5306 -1.1289 0.8864 0.6080 -2.5354 0.0597Columns 121 through 130 -0.3945 0.2704 0.5442 -0.7771 -0.3726 -1.8302 0.1689 -0.6360 1.1790 0.5008Columns 131 through 140 -1.1736 -1.2459 0.6323 -1.7518 0.0445 -0.7708 2.2329 -0.0955 1.1385 -0.6478Columns 141 through 150 -0.6545 -0.5816 0.2796 -1.9454 -1.3304 0.7644 -1.0927 -0.2109 -0.2701 0.5132Columns 151 through 160 -1.6118 -0.2717 -0.7958 0.3087 -0.1561 0.4236 0.7680 0.0751 -0.7888 1.1572Columns 161 through 170 -0.2305 0.5988 1.8641 -1.9176 -1.2155 1.2920 -1.1788 -0.0686 0.2361 0.8428Columns 171 through 180 -1.0419 0.6911 -1.1226 -1.3888 -0.0844 -0.5329 -1.0175 0.2501 -0.5334 1.0159Columns 181 through 190 -1.6682 0.4265 0.4460 0.3978 0.0045 -0.3508 -0.0499 -0.8099 0.0754 0.8382Columns 191 through 200 -0.7484 1.1823 -0.3542 -1.7466 -0.2513 1.4729 2.2374 -0.2594 1.1915 -0.87833. 模拟= 10的n=100的泊松分布的子样,并对它作分布的假设检验。程序代码:% = 10 时disp(= 10时:);lambda = 10; n = 100;x = poissrnd(lambda, 1, n);disp(x);subplot(1, 2, 1); hist(x); title(r.v. XP()的子样, = 10, n = 100);% = 100 时disp(= 100时:);lambda = 100; n = 100;x = poissrnd(lambda, 1, n);disp(x);subplot(1, 2, 2); hist(x); title(r.v. XP()的子样, = 100, n = 100);实验结果:= 10时:Columns 1 through 20 11 9 10 9 9 23 15 9 4 10 15 9 11 12 9 7 6 14 4 9Columns 21 through 4011 9 9 9 13 13 9 11 11 18 9 16 11 7 11 11 12 8 13 10Columns 41 through 606 16 15 11 11 4 4 6 7 6 10 8 7 15 9 9 10 14 13 8Columns 61 through 809 7 10 9 8 18 15 12 7 14 4 11 10 10 13 7 8 10 9 7Columns 81 through 100 11 9 10 13 7 9 7 6 15 10 6 8 12 15 10 10 10 8 8 9= 100时:Columns 1 through 20 94 105 95 93 107 101 89 105 97 102 108 104 103 113 120 107 102 114 87 103Columns 21 through 4074 97 107 96 93 99 95 108 102 96 88 90 120 99 93 102 90 90 88 90Columns 41 through 60113 95 85 95 92 98 95 93 96 91 95 99 98 108 110 104 92 106 91 98Columns 61 through 8089 112 109 95 102 102 91 99 88 120 96 110 109 97 103 107 104 100 114 94Columns 81 through 100 107 94 122 99 95 94 105 92 105 90 115 100 105 108 95 104 93 103 91 1074. 以P5 例2 铆钉直径子样为依据,作出它的直方图和经验分布函数。程序代码: % 设置铆钉直径的子样数据n = 200;x = 13.13:0.01:13.69; y=1,1,0,0,0,1,0,3,0,0,2,3,1,4,1,5,6,2,5,7,6,7,4,3,6,10,7,12,4,6,9,6,7,7,3,9,1,6,6,5,4,4,3,3,4,5,2,1,1,3,1,1,0,1,0,0,1;len = 0.05; start = 13.095:len:13.695;group = zeros(1,12); count = zeros(1,12); for i = 1:1:12 group(i) = (start(i) + start(i+1) / 2;endfor i = 1:1:57 j = 1 + floor(x(i)-13.095) / 0.05); count(j) = count(j) + y(i);endx1 = group; y1 = count / (n * len);subplot(1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论