Bayesian Statistics代写-logistic regression model代写
Bayesian Statistics代写

Bayesian Statistics代写-logistic regression model代写

Bayesian Statistics and Computing Problem Set 2

Possible points: 100

Bayesian Statistics代写 Find the mode of the above 4-dimensional density (you can use an optimization function, or write your own Newton-Raphson.)

1.Problem 1 [50 pts]  Bayesian Statistics代写

You are given the following dataset (Mendenhall et al. 1989):

x = c(21, 24, 25, 26, 28, 31, 33, 34, 35, 37, 43, 49, 51, 55, 25, 29, 43, 44, 46, 46, 51, 55, 56, 58)

y = c(rep(1, 14), rep(0, 10))

where yi represents the response (0 or 1) for each of the 24 patients as a function of the number of days of radiotherapy (xi) that patient received. (Note the above syntax means that the fifirst 14 outcomes were ones and the last 10 were zeros.)

Consider a Bayesian logistic regression model:

logit(Yi) = α0 + α1Xi

with the following structure:

α0 N(δ0, 2)

α1 N(δ1, 2)

δ0 N(0, 10)

δ1 N(0, 10)

(a) Find the analytic expression for the full joint posterior density for the 4 parameters of the logistic regression model above.

(b) Find the mode of the above 4-dimensional density (you can use an optimization function, or write your own Newton-Raphson.)  Bayesian Statistics代写

(c) Find the estimated curvature at the above mode.

(d) Based on the mode and curvature, fifind the 4-dimensional normal approximation to the joint posterior.

(e) Find the 2-dimensional marginal posterior density of (α0, α1) using the Monte Carlo approxima-tion

(f) Plot the bivariate contour plot of the 2-dimensional marginal posterior density of (α0, α1)

(g) Plot the 2 separate 1-dimensional marginal posteriors of α0 and α1

(h) Find the 1-dimensional normal approximations to the two marginals above, and plot them superimposed on the individual marginals.

(i) Do the individual 1-dimensional marginal modes for α0 and α1 diffffer from their 2-dimensional joint mode?

(j) Find the posterior mean and 95% HPD for α1

(k) Using importance sampling, perform a sensitivity analysis of the posterior mean and 95% HPD for α1, under alternative priors:

δ0 N(0, 100)

δ1 N(0, 100)

Bayesian Statistics代写
Bayesian Statistics代写

2.Problem 2 [50 pts]  Bayesian Statistics代写

Recall the genetic linkage example: animals are distributed into 4 categories: Y = (y1, y2, y3, y4) according to the genetic linkage model, where the probabilities of falling into the 4 categories are given as:

((2 + θ)/4, (1 θ)/4, (1 θ)/4, θ/4).

(a) Use the importance sampling to obtain the posterior mean and posterior standard deviation for the data Y = (125, 18, 20, 34). Use the matching Normal density as the importance function.

(b) Compare your importance sampling estimates of the posterior mean and posterior standard deviation to those obtained by the Normal approximation.

(c) Repeat the above two parts for the data Y = (14, 0, 1, 5).   Bayesian Statistics代写

(d) Compare the histograms of the importance weights for both data sets, and discuss the adequacy of the importance sampling estimate for each data set.

(e) Repeat all of the above parts using Beta densities as the importance functions. (First, fifind the appropriate Beta densities – be creative, but mindful of what a good importance sampling density needs to have!)

(f) Use importance sampling to obtain the normalized likelihood for the data Y = (125, 18, 20, 34). Plot this curve and tre true normalized likelhood in the same fifigure.

(g) Repeat the previous step for the data Y = (14, 0, 1, 5). Plot this curve and tre true normalized likelhood in the same fifigure.

 

更多代写:澳大利亚Online exam代考  ielts indicator代考  留学生exam帮考  Tourism Management旅游管理essay代写  留学生term paper写作  英语论文写作

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

Bayesian Statistics代写
Bayesian Statistics代写

发表回复