matlab數(shù)理統(tǒng)計(jì)例題_第1頁
matlab數(shù)理統(tǒng)計(jì)例題_第2頁
matlab數(shù)理統(tǒng)計(jì)例題_第3頁
免費(fèi)預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

x2+y2=1Functiontlpi%disp(’’);Clear;clc;N=input(‘請(qǐng)輸入模擬隨機(jī)點(diǎn)數(shù):‘);Mi=0;X=rand(2,n);Fori=1:1:nIf(x(1,i)∧2+x(2,i)∧2)<=1Mi=mi+1;End;End;Disp(strcat(‘pi=’,num2str(4*mi/n)));程序運(yùn)行結(jié)果:Pi=3.1415r.v.X~N(0,1),n=200的子樣,圖和經(jīng)驗(yàn)分布函數(shù),并作正態(tài)分布的假設(shè)檢驗(yàn)。程序代碼:x=normrnd(0,1,1,disp(x);histfit(x);title('r.v.X~N(0,1)的子樣,n=200');%進(jìn)行正態(tài)分布的假設(shè)檢驗(yàn)h=jbtest(x);ifh==0disp('檢驗(yàn)結(jié)果:接受H0,即認(rèn)為母體X的分布為正態(tài)分布。');elseend

disp('檢驗(yàn)結(jié)果:拒絕H0,即認(rèn)為母體X的分布不為正態(tài)分布。');實(shí)驗(yàn)結(jié)果:Columns1through102.63391.24810.33050.1003-2.10051.1459-0.1459-0.14830.28350.0098Columns11through201.77600.35681.0890-1.25160.1421-0.75800.0522-0.33551.47580.6184Columns21through300.80230.4382-1.25130.75032.62460.83420.8570-0.27541.9820-0.7954Columns31through400.6552-2.7659-0.9190-0.39891.23940.49212.0563-1.52980.3965-0.3391Columns41through50-0.65281.31872.0260-0.2819-2.3599-0.68221.8487-0.32840.1119-0.2097Columns51through60-2.28640.30661.5574-0.65950.1251-0.43130.75832.0325-1.50390.6782Columns61through700.2896-1.05110.50990.7738-1.09490.0018-0.2396-0.59172.3150-0.2251Columns71through80-0.70330.7618-0.7388-1.08390.96631.26350.3670-0.2249-0.2677-0.6903Columns81through900.44650.74291.2645-2.1291-2.0452-0.61700.1889-1.1256-0.49620.8256Columns91through1000.3461-0.6329-0.47190.36562.48091.08320.87920.3220-0.9326-1.0902Columns101through110-1.5519-1.26750.9666-0.04140.2991-0.4729-0.8793-0.1666-0.28470.0671Columns111through120-0.1349-0.22050.97200.0754-0.5306-1.12890.88640.6080-2.53540.0597Columns121through130-0.39450.27040.5442-0.7771-0.3726-1.83020.1689-0.63601.17900.5008Columns131through140-1.1736-1.24590.6323-1.75180.0445-0.77082.2329-0.09551.1385-0.6478Columns141through150-0.6545-0.58160.2796-1.9454-1.33040.7644-1.0927-0.2109-0.27010.5132Columns151through160-1.6118-0.2717-0.79580.3087-0.15610.42360.76800.0751-0.78881.1572Columns161through170-0.23050.59881.8641-1.9176-1.21551.2920-1.1788-0.06860.23610.8428Columns171through180-1.04190.6911-1.1226-1.3888-0.0844-0.5329-1.01750.2501-0.53341.0159Columns181through190-1.66820.42650.44600.39780.0045-0.3508-0.0499-0.80990.07540.8382Columns191through200-0.74841.1823-0.3542-1.7466-0.25131.47292.2374-0.25941.1915-0.8783模擬λ=10n=100程序代碼:%λ=10時(shí)=10時(shí):');lambda=10; n=100;x=poissrnd(lambda,1,disp(x);subplot(1,2,1); hist(x); title('r.v.的子樣,λ =10,n=100');%λ=100時(shí)=100時(shí):');lambda=100; n=x=poissrnd(lambda,1,n);disp(x);subplot(1,2,2); hist(x); title('r.v.X~(λ的子樣,λ =100,n=100');實(shí)驗(yàn)結(jié)果:λ=10時(shí):Columns1through2011 9 10 9 9 23 15 9 4 10 15 9 11 12 97 6 14 4 9Columns21through40119991313911111891611711111281310Columns41through6061615111144676108715991014138Columns61through80971098181512714411101013781097Columns81through10011 9 10 13 7 9 7 6 15 10 6 8 12 15 1010 10 8 8 9λ=100時(shí):Columns1through2094 105 95931071018910597102108104103113120107 102 11487103Columns21through4074971079693 9995108102968890120999310290908890Columns41through60113 95 85 95 92 98 95 93 96 91 95 99 98 108 110104 92 106 91 98Columns61through8089 112 109 95102 10291 99 88120 9611010997103107 104 100 11494Columns81through100107 94 122 99 95 94 105 92 105 90 115 100 105 108 95104 93 103 91 107P52程序代碼:%設(shè)置鉚釘直徑的子樣數(shù)據(jù)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);fori=1:1:12group(i)=(start(i)+start(i+1))/2;endfori=1:1:57j=1+floor((x(i)-13.095)/0.05);count(j)=count(j)+y(i);endx1=group; y1=count/(n*subplot(1,2,1);bar(x1,y1,'r');

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論