STAT 2011 Statistical Models { Semester 1, 2018Computer Practical Sheet Week 11Computer Problems for Week 11Note: Submit this completed work (as a pdf) throgh turnitin on canvas. This will give you apractice/training to submit the practical exmination in week13 during your class time.1. Generate a random sample of size n = 200 from exp(5) using rexp(.) in R and store in d1.The corresponding likelihood function with an unknown parameter based on randomsample of size n from fY (y; ) = 1 e y= is given byFollowing the approach in Q2(d) in week10 and using your data in d1 (treating isunknown), nd the mle for :2. The Weibull distribution with shape parameter a and scale parameter b has density givenbyfY (y) = (a=b)(y=b)a 1exp( (x=b)a):Generate a random sample of size n = 200 from a weibull distribution with a = 2 andb = 3 using rweibull(.,.,.) in R. Store them in d2. Using the likelihood function andfollowing the approach in Q2(d) in week10 for the data in d2 (treating the both a and bare unknown), nd the mle for = (a;b):3. Generate a random sample of size 50 from N(2;32) and store them in d3. Assuming thesedata are from an N( ;32); nd a 95% CI for using your data in d3. You may followthe steps below:mu=2Sigma=3n=50d3=rnorm(n,mu,sigma)LL=mean(d3)-qnorm(0.975)*sqrt(sigma/n)UL= mean(d3)+qnorm(0.975)*sqrt(sigma/n)CI=c(LL,UL)(a代做RSPSS语言、帮做R程序、Matlab程序调试、代写留学生Statistical Models实验作业) Investigate this interval (a 95% CI for ) and check whether the true mean = 2is in your interval. If not repeat this process until you obtain a satisfactory sampleand an interval to include = 2:(b) Contruct a 90% CI for using your sample in d3.PTO14. Generate a sample of 100 from the standard normal distribution and store them in d4.Assuming this data come from N( ;1) with unknown mean ; construct a 95% CI forthis mean, : Repaeat this process 50 times and plot all 50 CIs following the steps:samsize 0 | confint[,2]plot(c(0, 0), c(1, replicates), col=&"black&", typ=&"l&",ylab=&"Samples&",xlab=&"Confidence Interval&")segments(confint[,1], 1:replicates, confint[,2], 1:replicates,col=outside)How many CIs do not include 0 (the true population mean)? How many CIs do youexpect not to include the true population mean? Repeat this process until you obtainsatisfactory samples to include = 0 approximately 95%.5. Repear Q4 to construct 90% CI for the population mean assuming that it is unknownand coming from N( ;1):6. Generate a sample of 100 from N(5;22) distribution and store the data in d6. Assumingthe data in d6 are from N( ;22); construct a 92% CI for the population mean, : Repaeatthis process 50 times and plot all 50 CIs following the steps in Q4. Comment on yourresults.last adjustments: May 21, 2018 by SP转自:http://ass.3daixie.com/2018052758777167.html
讲解:RSPSS、R、Matlab、Statistical Models
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...