Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the trivariate random vector ( Y 1 , Y 2 , Y 3 ) with the density f ( y 1 , y 2
Consider the trivariate random vector with the density
exp;
where is the normalizing constant so that the density integrates to
Problem a points
Obtain the distribution of conditional densities of for all possible distinct values of Show
your work.
Problem b points
Implement the Gibbs sampling algorithm to generate values from the joint density of Specifically,
run a chain with points, and burn the first initially generated values. Then, print the approximation
for the mean and covariance matrix of based on your generated sample. Also, plot the histogram
of the marginals distribution of only superimposed by a smoothed density curve. Set breaks for the
histogram, and use the density function for the density curve to be superimposed.
Problem c points
Apply the MetropolisHastings algorithm to generate values from using a chain with points.
Set the proposal density to the trivariate normal density with covariance matrix equal to two times the
identity matrix ie Your code should implement the following:
Use the mvrnorm function in the package MASS to generate multivariate normal values.
Begin your simulation with seed
Start with the initial value
Your code should compute the acceptance rate and print it at the end.
Burn the first points from the chain, and plot the histogram of the marginals of and
superimposed by a smoothed density curve. Set breaks for the histogram, and use the density
function for the density curve to
be superimposed.
need rcode.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started