- Markdown留学生作业代做、代做R课程设计作业、R编程语言作
- COURSEWORK 1 FOR INF2B (ADS THRE
- 代做programming作业、R课程作业代写、代做R编程语言作
- 代做R程序、R编程代写、代写留学生R课程设计、R实验作业代做、代
- 代做spreadsheet留学生作业、R程序作业代写、代做R语言
- 代做spreadsheet留学生作业、R程序作业代写、代做R语言
- 代做Graphics留学生作业、R课程作业代写、代做R编程设计作
- 代做留学生CE4703语言、R编程作业帮做、代做R实验作业、R程
- CSC 321/621 – Spring 2019
- 代做data留学生作业、R课程设计作业代做、代写system作业
Statistics 1 assignment - 2019March 11, 2019 This computer practical counts 10% towards your final mark and is dueon Friday 22nd March by 5pm. It should be handed in in the dedicated blue box “Probability and Statistics”by the entrance of the main building. Do get started on week 19 and go to the drop in session in the computerlab in order to get help. You should use R Markdown for your code, output and associated commentsand print the corresponding pdf file. Remember to make clear whichquestion you are answering and include your name at the beginning of thedocument. Use pen and paper to answer the questions not involving code or numericalexperiments. Stapple the two documents together and make sure that your name appearsclearly on the first page.In Chapter 2 we have seen how a QQplotor a probability plot can be usefulto assess whether a sample is distributed according to a specific probabilitydistribution. Although useful we would like to complete this graphical methodwith a statistical hypothesis test which would lead to a more objective andprincipled decision. Numerous tests have been proposed in the literature (inparticular in order to test normality) and we focus here on the Anderson-Darlingtest. For an observed sample x1,...,xn the Anderson-Darling (AD) test statisticis given byT(x1,...,xn) = nZ +11(Fn(y)FX(y; ))2FX(y; )(1FX(y; ))fX(y; )dy,where FX(y) is the hypothesised cumulative distribution for the data, fX(y) isthe corresponding probability density andFn(y) = #{i 2 {1,...,n}: xi y}n ,is the empirical distribution function of the observed sample.11. (2 marks) State, in words and at most two sentences, the null and alternativehypotheses in the present scenario.2. (3 marks) Briefly explain why the AD statistic may be useful to achieveour goal? In particular briefly comment on the roles played by the threeterms, (Fn(y; )FX(y; ))2, FX(y; )(1FX(y; )) and fX(y; ).3. (2 marks) Describe the form of a critical region, give the theoreticalformula for the type I error and the theoretical formula for the pvaluefor this test and an observed statistics tobs. You should precisely statethe probability distribution of any random variable you may use and canassume ? to be known.While the expression above leads to an intuitive interpretation of what thestatistic can achieve, a more useful expression is given byT(x1,...,xn) = n,where x(1), x(2),...,x(n) is the order statistic of the sample, as defined in Chapter1. Most often is unknown and must be estimated from the observedsample and tobs can then be computed. From now on assume that we want totest whether a sample is drawn from a normal distribution. The two datasetsx1 and x2 referred to below can be downloaded usingload(url(https://people.maths.bris.ac.uk/~maxca/stats1/stats1-assignment.RData))4. (4 marks) Write a function compute.ad.test(xs) which takes in a vectorof observations xs and returns the Anderson-Darling statistics. Youshould test your function on the two datasets x1 and x2.[Hint: the ad.test function in the nortest R library (which is not installedby default), may be a source of inspiration for your code and maybe used to check that your own code produces plausible values (you willnot get marks for using it but some of you may find it useful/reassuring).You can see the code of the function by simply typing ad.test. Note thatad.test renormalizes the data and that you should not do this here.]To complete the statistical procedure we require computing the pvalue.Evenwhen is assumed known, the distribution of T(X1, X2,...,Xn) under the nullhypothesis is not tractable and it is unlikely that it will be when ? is estimated.The numerical method below works in both scenarios.5. (3 marks) Write pseudo-code describing an algorithm, based on simulationand similar to the procedure used in Section 4.3 of the lecture notesto compare the sampling distributions of three estimators, to compute thepvaluefor an observed statistics tobs.6. (3 marks) Write the R code corresponding to your pseudo-code to computethe pvaluescorresponding to x1 and x2, assuming that the empiricalmean and variance are used to estimate ?. For each of x1 and x22plot the histogram of the simulated statistics and draw a vertical line forthe position of the observed test statistic and on separate graphs plot thecorresponding QQ-plots (you may use the functions qqnorm and qqline).Conclusions?The approach is also often referred to as a Monte Carlo method. Note thatstatistical tables and approximate formulae have been constructed and derivedfor this test: as indicated in [Stephens 1974] these are based on Monte Carlosimulations. Such approximate formulae, are used in the ad.test function inthe nortest R library.7. (3 marks) Explain in a few lines how you would adapt your code in orderto test whether a sample is sampled from an exponential distribution.What is your conclusion about the generality of the approach?[1] Stephens, M. A. “EDF Statistics for Goodness of Fit and Some Comparisons.”Journal of the American Statistical Association 69, no. 347 (1974):730-37. doi:10.2307/2286009.本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp
网友评论