美文网首页
讲解:MATH4007、STATISTICS、R、RMatlab

讲解:MATH4007、STATISTICS、R、RMatlab

作者: haoyingdian | 来源:发表于2019-12-29 10:26 被阅读0次

    MATH4007 COMPUTATIONAL STATISTICSAssessed Coursework 1 — 2019/2020The deadline for this work is 3pm, Wednesday 11 December 2019, to be submitted viathe “Coursework 1 Submission” link on Moodle. Unauthorised late submission will be penalisedby 5% of the full mark per day. Work submitted more than one week late will receive zero marks.All components (see below) must be submitted by the deadline for the work to be consideredon time. You are reminded to familiarise yourself with the guidelines concerning plagiarism inassessed coursework (see the student handbook), and note that this applies equally to computercode as it does to written work. The submission should contain:1. A pdf file containing any computational results (plots/relevant output) and discussion. Thiscan be produced using e.g. R Markdown, or by copying output into a Word document.Please convert any documents to pdf for uploading.2. A pdf of your theoretical working. A scan of handwritten work is fine, but you could alsotypeset using Latex if you prefer. If it’s more convenient, you can combine this and theabove part into one, e.g. if you wish to put everything in one Latex document, but this isnot required.3. An R script file, i.e. with a .r extension containing your R code. This should be clearlyformatted, and include brief comments so that a reader can understand what it is doing.The code should also be ready to run without any further modification by the user, andshould reproduce your results (approximately, for simulation-based results).Please make sure that all required working, results, details of implementation and discussion arecontained in components 1 and 2 of the above list and not in the script file. The script filewill only be used for verification of results. The exception is for the R code itself, whereby it issufficient to say “refer to script file” where a question asks you to write R code.1. Data y = (y1, . . . , yn) are assumed to come from a N(µ, σ2) distribution. A Bayesiananalysis is to be performed for the parameters µ and σ, which are assumed to haveindependent prior distributions with µ ∼ N(µ0, τ 20) and p(σ) ∝1σ, where µ0MATH4007作业代做、代写STATISTICS作业、代做R课程设计作业、R编程语言作业代做 调试Matlab程序|代 and τ20are known constants. (The prior on σ corresponds to a “uniform” prior on log(σ), whichis a standard way to specify a noninformative prior on σ.)(a) Verify that the posterior distribution is.(b) The observed data are−1.97 0.46 1.14 − 1.63 2.95 − 3.23 − 3.18 0.37 0.45 − 2.80.The values µ0 = 0 and τ0 = 100 are chosen to reflect vague prior information aboutµ. Use the 2-d mid-ordinate rule to calculate K.(c) The marginal posterior distribution of µ isp(µ|y) = Z ∞0p(µ, σ|y)dσ,which is not available in closed form. Give full details of Laplace’s method to computep(µ|y) at a particular point µ.(d) Write a function in R to compute p(µ|y) at a particular point µ using Laplace’s methodderived in (c).(e) Write a function in R to perform the Golden-ratio method to find the mode of p(µ|y),using your R function from part (d) as the function to optimize.(f) Hence, find the mode of p(µ|y) to an accuracy of 1 decimal place.[20]2. A random variable Z is said to follow a log-normal distribution with parameter β if Z =exp(X), where X ∼ N(0, β). The density of a random variable Z which follows a Gamma distribution with parametersa and b isp(z) ∝ za−1exp{−bz}.Prove that the marginal distribution of λ is the Gamma distribution with parametersa = 10 and b = 10.(b) Prove that the conditional distribution of Y given λ, p(y|λ), is log-normal withparameter 1λ.(c) Describe how these results can be used to simulate from the marginal distributionp(y).(d) Hence, simulate 10000 samples from the marginal distribution p(y). Use your samplesto estimate the mean and variance of the distribution, and P(Y > 10).(e) The true marginal pdf of Y iswhere k = 0.389. Plot a histogram of your samples, scaled to have area 1. Overlaythe true pdf and comment on the agreement.Continued overleaf2(f) The marginal distribution of Y is of a type commonly used in reliability analysis,where “unusually large” observations have a non-negligible probability content. Withreference to your histogram, explain why this distribution might be useful for modellingsuch data.[20]3转自:http://www.6daixie.com/contents/18/4571.html

    相关文章

      网友评论

          本文标题:讲解:MATH4007、STATISTICS、R、RMatlab

          本文链接:https://www.haomeiwen.com/subject/tfkyoctx.html