PMF留学生辅导、讲解algorithm、辅导Matlab、Matlab编程调试

- 首页 >> 其他
Homework 4
Question 1
Suppose that has a multinomial distribution with PMF.
Suppose that the prior distribution for  is0. Derive a Gibbs sampling algorithm to sample from the posterior
distribution of . Implement your algorithm in Matlab for the case where / = 5,
(8,7,6,5,4), = ,6 = 1 to obtain an estimate of the posterior mean of . Use =1000
Gibbs iterations and 7 = 100 burn-in samples.
Question 2
Letis a random sample from. Choose the prior for
Provide a Gibbs sampling algorithm for sampling from the posterior distribution of.Question 3
Write a Matlab code to implement model selection based on the LASSO method (use the Matlab
quadprog function). Please select the parameter X by finding the minimum of BIC[on a grid of X
values.
Apply your code to the data shown in the table below. Consider the full model 8, and evaluate
BIC[ on the grid C0,0.001,0.002, … ,1F of X values .
Compare your results to the Bayesian variable selection method described in the slides. Set c =10, c7 = 0, G = 0.05, , = 0.5, and (d) = ∏ 0.5f$0.5f$>.
In addition, compare with model selection results obtained with the PRESS and BIC criteria. Question 4:
Write a Matlab code to fit a stationary (implies mean and variance are constants) Gaussian
random field model with Gaussian correlation function and compute its posterior mean and 95%
interval predictions (for simplicity, you may write a code that works just for the case of a single
real input ). Apply your code to the data below, and plot the data, posterior mean, 95%
prediction intervals, and the true function q = sin (7) in the same figure. Please report the
maximum likelihood estimates of the prior mean :, prior variance , and parameter Q in the
Gaussian correlation function.q
0 sin(7 × 0)
0.2 sin(7 × 0.2)
0.4 sin(7 × 0.4)
0.6 sin(7 × 0.6)
0.8 sin(7 × 0.8)
1 sin(7 × 1)