首页 统计计算期中试卷

统计计算期中试卷

举报
开通vip

统计计算期中试卷云南财经大学2013至2014学年第一学期《ComputatinoalStatistics(统计计算)》课程期中考试试卷(试)Answerallquestions.Marksareshowninparentheses.Submita.rarfilenamedby“yourClassname_Chinesename_U.no.”Therarfileshouldatleastincludefive.mfiles(1.mfor1q),andawordfilethatconciselysummarizesyourfinal...

统计计算期中试卷
云南财经大学2013至2014学年第一学期《ComputatinoalStatistics(统计计算)》课程期中考试 试卷 云南省高中会考试卷哪里下载南京英语小升初试卷下载电路下试卷下载上海试卷下载口算试卷下载 (试)Answerallquestions.Marksareshowninparentheses.Submita.rarfilenamedby“yourClassname_Chinesename_U.no.”Therarfileshouldatleastincludefive.mfiles(1.mfor1q),andawordfilethatconciselysummarizesyourfinalanswers.1.(20marks)Whenarandomvariableisequallylikelytobeeitherpositiveornegative,thentheLaplacianorthedoubleexponentialdistributioncanbeusedtomodelit.TheLaplacianprobabilitydensityfunctionforisgivenbyWriteaMATLABfunctionthatwillevaluatetheLaplacianprobabilitydensityfunctionforgivenvaluesinthedomain.WriteaMATLABfunctionthatwillevaluatetheLaplaciancumulativedistributionfunction.Plottheprobabilitydensityfunctionwhen.Answer:lambda=randx=randpdf=exppdf(x,1/lambda)cdf=exppdf(x,1/lambda)lambda=1x=(0:10);pdf=exppdf(x,1/lambda);subplot(1,2,1),plot(x,pdf)title('ProbabilityDensityFunction')xlabel('X'),ylabel('f(X)')axis((0:10))axissquare2.(20marks)Generatearandomsampleofsize500thatisuniformlydistributedovertheinterval.Plottheempiricaldistributionfunctionovertheinterval.Answer:n=500x=randn(1,500)(f,y)=ecdf(x)subplot(-0.1,1.1)plot(y,f)3.(20marks)Generatearandomsampleofsize100fromauniformdistribution(setthegeneratortotheinitialstate).Whatarethesamplequantilesfor?Answer:>>x=sort(rand(1,100));q1=median(x(1:46));q2=median(x(1:78));q3=median(x(1:96));q4=median(x(85:100))q4=0.87804.(20marks)Writeafunctionthatwillgeneratechi-squarerandomvariableswithdegreesoffreedombygeneratingstandardnormals,squaringthemandthenaddingthemup.Thisusesthefactthatischi-squarewithdegreesoffreedom.Generatesomerandomvariablesandplotinahistogram.Thedegreesoffreedomshouldbeaninputargumentsetbytheuser.Answer:%whenγ=4,wecanget:Z1=randnX1=sum(Z1.^2)Z2=randnX2=sum(Z2.^2)Z3=randnX3=sum(Z3.^2)Z4=randnX4=sum(Z4.^2)Y=X1+X2+X3+X4Z1=-0.4326X1=0.1871Z2=-1.6656X2=2.7742Z3=0.1253X3=0.0157Z4=0.2877X4=0.0828Y=3.05975.(20marks)Generatediscreteuniformrandomnumbersthathasprobabilitymassfunctiongivenbyandshowtheportionofeachnumberyougenerated.Answer:%Setupstoragespaceforthevariables.X=zeros(1,100);%Thesearethex'sinthedomain.x=0:5;%Thesearetheprobabilitymasses.pr=[0.20.250.150.4];%Generate100rv’sfromthedesireddistribution.fori=1:100u=rand;%GeneratetheU.ifu<=pr(1)X(i)=x(1);elseifu<=sum(pr(1:2))%Ithastobebetween0.2and0.45.X(i)=x(2);elseifu<=sum(pr(2:3))X(i)=x(3)elseX(i)=x(4);%Ithastobebetween0.6and1.endend%Findtheproportionofeachnumber.x1=length(find(X==1))/100x2=length(find(X==2))/100x3=length(find(X==3))/100x4=length(find(X==4))/100x1=0.2700x2=0x3=0.5900x4=0NOTE:Youshoulduseefficientvector/matrixoperationsandavoidusingfor/whileloopsasfaraspossible.
本文档为【统计计算期中试卷】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: ¥16.9 已有0 人下载
最新资料
资料动态
专题动态
个人认证用户
慢慢老师
暂无简介~
格式:pdf
大小:159KB
软件:PDF阅读器
页数:0
分类:其他高等教育
上传时间:2021-06-18
浏览量:10