《随机过程》课程实验报告Word格式文档下载.docx
- 文档编号:17956302
- 上传时间:2022-12-12
- 格式:DOCX
- 页数:18
- 大小:96.12KB
《随机过程》课程实验报告Word格式文档下载.docx
《《随机过程》课程实验报告Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《《随机过程》课程实验报告Word格式文档下载.docx(18页珍藏版)》请在冰豆网上搜索。
%该函数用于输出服从所给定的X~b(k,p1)的m个随机数
%e,E分别为所输出随机数的和原先的均值
%v,V分别为所输出随机数的和原先的方差
%p值为给定的X~b(k,p1)的分布列中的概率
functionr=bino(m,n,k,p1)
g=0:
n;
y=binocdf(g,k,p1)
fori=2:
(k+1)
p
(1)=y
(1);
p(i)=y(i)-y(i-1);
end
R=rand(1,m)
forj=1:
m
forl=2:
k
if0<
R(j)&
R(j)<
p
(1)
x(j)=0;
elseify(l-1)<
y(l)
x(j)=l-1;
end
p
x
e=mean(x)
E=k*p1
v=var(x)
V=k*p1*(1-p1)
2.
%该程序用于输出Poisson过程的模拟
%m1,m2,m3为Poisson过程的最终人数,n为Poisson过程的强度
%x,y,z分别m1,m2,m3个人所到达的的时间间隔
%t1,t2,t3分别m1,m2,m3个人所到达的的时刻
%k1,k2,k3检验是否与Poisson过程的强度相近
functiong=poisson1(m1,m2,m3,n)
R1=rand(1,m1);
R2=rand(1,m2);
R3=rand(1,m3);
fori=1:
m1
x(i)=-(log(1-R1(i)))/n;
m2
y(i)=-(log(1-R2(i)))/n;
y
m3
z(i)=-(log(1-R3(i)))/n;
z
t1
(1)=x
(1);
t1(i)=t1(i-1)+x(i);
t2
(1)=y
(1);
t2(i)=t2(i-1)+y(i);
t3
(1)=z
(1);
t3(i)=t3(i-1)+z(i);
t1
t2
t3
k1=m1/t1(m1)
k2=m2/t2(m2)
k3=m3/t3(m3)
N1=1:
m1;
N2=1:
m2;
N3=1:
m3;
plot(t1,N1,'
g.'
)
holdon
plot(t2,N2,'
r.'
plot(t3,N3,'
.'
gridon
xlabel('
t'
ylabel('
N'
title('
Poisson¹
ý
³
Ì
Ä
£
â
'
3.
%该程序用于markov链模拟
%R服从U~(0,1),s=[0123]
%p为转移概率矩阵A各行的概率累积值,X0,X1,X2,X3分别为从状态空间里的0,1,2,3为初值
functionr=markov(A,k)
x=[0123];
n=length(A);
R=rand(1,k);
g1=1;
g2=2;
g3=3;
g4=4;
fori=0:
(n-1)
forj=2:
n
p(i+1,1)=A(i+1,1);
p(i+1,j)=A(i+1,j)+p(i+1,j-1);
form=1:
k
R(m)&
R(m)<
p(g1,1)
X0(m)=x
(1);
elseifp(g1,j-1)<
p(g1,j)
X0(m)=x(j);
g1=X0(m)+1;
p(g2,1)
X1(m)=x
(1);
elseifp(g2,j-1)<
p(g2,j)
X1(m)=x(j);
g2=X1(m)+1;
p(g3,1)
X2(m)=x
(1);
elseifp(g3,j-1)<
p(g3,j)
X2(m)=x(j);
g3=X2(m)+1;
p(g4,1)
X3(m)=x
(1);
elseifp(g4,j-1)<
p(g4,j)
X3(m)=x(j);
g4=X3(m)+1;
R
X=[0X0]
Y=[1X1]
Z=[2X2]
F=[3X3]
N=0:
100;
plot(N,X,'
r-'
plot(N,Y,'
m*'
plot(N,Z,'
g+'
plot(N,F,'
b-.'
X'
markov链模拟,状态空间s=[0123]'
四、问题求解结果与结论
bino(100,10,10,0.6)
y=
0.00010.00170.01230.05480.16620.36690.61770.83270.95360.99401.0000
R=
Columns1through11
0.10480.85840.69820.73370.65050.51630.32640.66180.11760.14780.0198
Columns12through22
0.96430.97040.12390.46740.65670.29020.75450.55810.42780.26720.7537
Columns23through33
0.89840.72840.40680.93830.25540.53320.95480.26770.25010.92770.0686
Columns34through44
0.29940.59160.20330.63590.79840.50170.65080.79600.23340.60080.1125
Columns45through55
0.51580.83780.92080.49820.27760.65250.91730.50980.97420.19730.1112
Columns56through66
0.29740.39640.42080.31150.69380.09190.40210.29520.30650.10560.5938
Columns67through77
0.28270.15520.00070.28360.55080.87090.04230.90470.13100.83370.8005
Columns78through88
0.91790.13730.50470.40500.17360.57520.60620.21440.51990.98920.4899
Columns89through99
0.69490.41140.03480.29280.80140.34650.08330.51110.36680.73950.5247
Column100
0.8045
p=
0.00010.00160.01060.04250.11150.20070.25080.21500.12090.04030.0060
x=
Columns1through19
4877765744399467576
Columns20through38
6578768569558456577
Columns39through57
6775646886578695456
Columns58through76
6574655465415683848
Columns77through95
7846656656967635754
Columns96through100
65767
e=
5.9400
E=
6
v=
2.3600
V=
2.4000
2.poisson1(50,100,200,3)
Columns1through12
0.86591.00610.02300.97380.22880.02350.05560.11700.06160.44290.70590.6356
Columns13through24
0.37160.53400.03530.24650.02020.56000.14140.58850.43030.13710.07920.1384
Columns25through36
0.20500.25080.17090.46470.00910.15650.06890.15510.13390.00620.38530.3719
Columns37through48
0.59670.19110.33660.36470.14660.12780.39020.00890.93740.32830.04840.9296
Columns49through50
0.21030.9020
1.20700.11150.25800.00420.05700.14440.49450.12870.26880.15940.46241.4015
0.19750.02590.03530.13660.11520.82950.23420.28860.01770.10340.50910.2574
0.93650.25710.17751.10890.30470.94490.47710.03920.11190.07970.17860.2322
0.61340.50410.29210.24400.11850.39060.32950.49930.67500.00890.31860.0737
Columns49through60
0.66690.87800.62630.01320.24970.15080.02420.09510.02030.08770.91340.5479
Columns61through72
0.01291.14890.88660.01570.13330.42020.01070.09270.12200.59860.24590.0409
Columns73through84
0.05000.17280.05780.96350.04640.08620.00900.73820.42540.07610.13880.3024
Columns85through96
0.31600.02270.06480.06350.64710.28880.07510.37510.03490.00140.27500.1469
Columns97through100
0.18850.10680.23490.1017
z=
0.00190.86350.22740.08330.72110.04270.25310.06221.12310.96760.22550.0610
0.41360.47130.21790.60370.60480.28160.50940.21530.50120.75441.04440.0469
0.32820.46150.07060.19550.11510.19090.37980.09720.68560.25610.81160.2091
0.15570.39420.47150.79700.02140.51000.06130.59630.04620.22580.60960.2880
0.10750.15000.25480.92800.11100.34040.01280.47180.06920.23750.29890.0911
0.22170.84450.15010.02190.31090.06380.33260.14710.39150.01890.13190.3163
1.35470.20210.09740.01260.27730.01560.92570.20170.67920.87260.38140.1473
0.53920.28620.38010.29110.79920.76210.20310.06700.13240.00800.00240.5424
Columns97through108
0.09260.52430.53480.07650.22560.63250.32750.08061.20120.25660.59990.5635
Columns109through120
0.26980.18650.11520.54091.49620.23670.07060.25970.09530.16560.07710.5136
Columns121through132
0.21360.21350.42220.04571.00400.44250.32130.27490.08620.72110.24050.1808
Columns133through144
0.49770.39821.54440.29960.05670.04670.06230.02280.15680.43200.16430.0122
Columns145through156
0.00190.35590.46570.02330.13810.22930.12460.37160.55080.37660.88990.3395
Columns157through168
0.28361.55840.01870.02961.08350.17330.38540.17361.76550.60650.09410.1796
Columns169through180
0.15400.52310.01090.53070.01150.00620.19770.60570.52990.92080.07490.6618
Columns181through192
0.09850.02051.15450.02260.08690.01120.04560.37980.00960.63660.11050.1827
Columns193through200
0.35310.84860.11531.13510.50380.03010.06570.0704
t1=
0.86591.87201.89502.86883.09763.12113.17673.29373.35533.79824.50415.1397
5.51136.04536.08066.32716.34736.90737.04877.63728.06758.20478.28388.4223
8.62728.87809.04909.51369.52279.67929.74819.903210.037110.043310.428610.8005
11.397211.588311.924912.289612.436212.564012.954212.963013.900414.228714.277115.2068
15.417016.3191
t2=
1.20701.31861.57651.58081.63771.78222.27662.40532.67412.83353.29584.6974
4.89494.92084.95605.09275.20796.03746.27166.56026.57796.68137.19047.4478
8.38438.64148.81909.927910.232611.177511.654611.693811.805611.885312.063912.2961
12.909413.413613.705613.949614.068014.458614.788115.287515.962415.971416.290016.3636
17.030617.908518.534818.548018.797718.948518.972719.067919.088219.175920.089220.6371
20.650021.798922.685522.701222.834523.254723.265323.358123.480124.078724.324624.3655
24.415524.588324.646225.609725.656025.742225.751226.489426.914826.990827.129627.4320
27.748027.770727.835427.898928.546028.834828.910029.285029.320029.321329.596329.7432
29.931830.038530.273530.3752
t3=
0.00190.86541.09281.17611.89721.93992.19302.25523.37844.34594.57154.6325
5.04615.51745.73536.33896.94387.22537.73487.95008.45129.205710.250010.2970
10.625211.086711.157311.352811.467911.658812.038612.135812.821413.077513.889214.0982
14.253914.648115.119515.916515.937916.447916.509217.105517.151717.377517.987018.2750
18.382518.532518.787319.715319.826320.166720.179520.651320.720520.958021.256921.3480
21.569722.414222.564322.586222.897122.960823.293423.440523.832023.850923.982924.2991
25.653925.856025.953425.966026.243326.258927.184627.386328.065528.938129.319529.4668
30.006130.292330.672430.963531.762732.524832.727932.795032.927432.935432.937833.4802
33.572834.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 随机过程 随机 过程 课程 实验 报告