Question: Using a Gibbs sampler, draw k = 1 0 0 0 samples from the posterior distribution by repeatedly sequentially sampling from the conditional posteriors |

Using a Gibbs sampler, draw k=1000 samples from the posterior distribution by repeatedly
sequentially sampling from the conditional posteriors |Y,x and x|Y,.
For this numerical experiment, use the 3232 phantom image with the CT imaging matrix R
created using the same MATLAB code from Lecture using angles =0:10:180(or rewrite
in Python - if this causes trouble, I can also provide the matrix in a .mat file).R should be a
9311024 matrix.
For the other parameters, use true=104(i.e.true=10-2, only used to generate the data Y),
prior=10-2,prior=10-4,prior=10-4, and an initial guess for x equal to the least squares
solution (compute via R "backslash" Y in MATLAB). To draw samples from a multivariate
normal, use MATLAB's mvnrnd command, supplying the mean vector and covariance matrix.
Note: This may take a few minutes to run, depending on how powerful your machine is.
Please provide me the solution in Python.
 Using a Gibbs sampler, draw k=1000 samples from the posterior distribution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!