講解:MATH4007、STATISTICS、R、RMatlab|SQL

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作業(yè)代做、代寫(xiě)STATISTICS作業(yè)、代做R課程設(shè)計(jì)作業(yè)、R編程語(yǔ)言作業(yè)代做 調(diào)試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轉(zhuǎn)自:http://www.6daixie.com/contents/18/4571.html

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容