概率论matlab实验报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
概率论与数理统计matlab上机
实验报告
班级:
学号:
姓名:
指导老师:
实验一常见分布的概率密度、分布函数生成
[实验目的]
1. 会利用MATLAB软件计算离散型随机变量的概率,连续型随机变量概率密度值。
2.会利用MATLAB软件计算分布函数值,或计算形如事件{X≤x}的概率。
3.会求上α分位点以及分布函数的反函数值。
[实验要求]
1.掌握常见分布的分布律和概率密度的产生命令,如binopdf,normpdf
2. 掌握常见分布的分布函数命令,如binocdf,normcdf
3. 掌握常见分布的分布函数反函数命令,如binoinv,norminv
[实验内容]
常见分布的概率密度、分布函数生成,自设参数
1、X~B(20,0.4)
(1)P{恰好发生8次}=P{X=8}
(2)P{至多发生8次}=P{X<=8}
(1)binopdf(8,20,0.4)
ans =
0.1797
(2)binocdf(8,20,0.4)
ans =
0.5956
2、X~P(2)
求P{X=4}
poisspdf(4,2)
ans =
0.0902
3、X~U[3,8]
(1)X=5的概率密度
(2)P{X<=6}
(1) unifpdf(5,3,8)
ans =
0.2000
(2) unifcdf(6,3,8)
ans =
0.6000
4、X~exp(3)
(1)X=0,1,2,3,4,5,6,7,8时的概率密度
(2)P{X<=8}
注意:exp(3)与教材中参数不同,倒数关系(1)exppdf(0:8,3)
ans =
Columns 1 through 3
0.3333 0.2388 0.1711
Columns 4 through 6
0.1226 0.0879 0.0630
Columns 7 through 9
0.0451 0.0323 0.0232
(2) expcdf(8,3)
ans =
0.9305
5、X~N(8,9)
(1)X=3,4,5,6,7,8,9时的概率密度值
(2) X=3,4,5,6,7,8,9时的分布函数值
(3)若P{X<=x}=0.625,求x
(4)求标准正态分布的上0.025分位数
(1)normpdf(3:9,8,3)
ans =
Columns 1 through 3
0.0332 0.0547 0.0807 Columns 4 through 6
0.1065 0.1258 0.1330 Column 7
0.1258
(2)normcdf(3:9,8,3)
ans =
Columns 1 through 3
0.0478 0.0912 0.1587 Columns 4 through 6
0.2525 0.3694 0.5000 Column 7
0.6306
(3)norminv(0.625,8,3)
ans =
8.9559
(4)norminv(0.975,0,1)
ans =
1.9600
6、X~t(3)
(1)X=-3,-2,-1,0,1,2,3时的概率密度值(2)X=-3,-2,-1,0,1,2,3时的分布函数值
(3)若P{X<=x}=0.625,求x
(4)求t分布的上0.025分位数
(1)tpdf(-3:3,3)
ans =
Columns 1 through 3
0.0230 0.0675 0.2067 Columns 4 through 6
0.3676 0.2067 0.0675 Column 7
0.0230
(2)tcdf(-3:3,3)
ans =
Columns 1 through 3
0.0288 0.0697 0.1955 Columns 4 through 6
0.5000 0.8045 0.9303 Column 7
0.9712
(3)tinv(0.625,3)
ans =
0.3492
(4)tinv(0.975,3)
ans =
3.1824
7、X~卡方(4)
(1)X=0,1,2,3,4,5,6时的概率密度值
(2) X=0,1,2,3,4,5,6时的分布函数值
(3)若P{X<=x}=0.625,求x
(4)求卡方分布的上0.025分位数
(1)chi2pdf(0:6,4)
ans =
Columns 1 through 3
0 0.1516 0.1839 Columns 4 through 6
0.1673 0.1353 0.1026 Column 7
0.0747
(2)chi2cdf(0:6,4)
ans =
Columns 1 through 3
0 0.0902 0.2642 Columns 4 through 6