标签:function Metropolis Assignment Question MAST90125 Poisson Bayesian using
Assignment 2, Question 1 MAST90125: Bayesian
Statistical Learning
Due: Friday 20 September 2019
There are places in this assignment where R code will be required. Therefore set the random
seed so assignment is reproducible.
set.seed(123456) #Please change random seed to your student id number.
Question One (12 marks)
In generalised linear models, rather than estimating effects from the response data directly, we model through
a link function, η(θ), and assume η(θ)i = x0
iβ. The link function can be determined by re-arranging the
likelihood of interest into the exponential family format,
p(y|θ) = f(y)g(θ)e
a) Re-arrange the Poisson probability mass function into the exponential family format to determine the
canonical link function. The Poisson pmf is
P r(y|λ) = λ
To explore some properties of Metropolis sampling, consider the dataset Warpbreaks.csv, which is on LMS.
代做MAST90125课程作业、代写R编程设计作业、代做Statistical Learning作业
This dataset contains information of the number of breaks in a consignment of wool. In addition, Wool type
(A or B) and tension level (L, M or H) was recorded.
b) Fit a Poisson regression to the warpbreak data, with Wool type and tension treated as factors using the
function glm in R. Report co-efficient estimates and the variance-covariance matrix.
c) Fit a Bayesian Poisson regression using Metropolis sampling. Assume flat priors for all coefficients.
Extract the design matrix X from the glm fitted in a). For the proposal distribution, use a Normal
distribution with mean θ
(t−1) and variance-covariance matrix c
2Σˆ where Σ is the variance-covariance
matrix from the glm fit. Consider three candidates for c, 1.6/
of parameters estimated. Run the Metropolis algorithm for 10,000 iterations, and discard the first 5,000.
Report the following:
• Check, using graphs and appropriate statistics, that each chain converges to the same distribution. To
do this, you may find installing the R package coda helpful.
• The proportion of candidate draws that were accepted.
• The effective sample size for each chain.
• What do you think is the best choice for c. Does this match the results stated in class on efficiency and
optimal acceptance rate?
因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
微信:codehelp
标签:function,Metropolis,Assignment,Question,MAST90125,Poisson,Bayesian,using 来源: https://www.cnblogs.com/lpka/p/11519845.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。