Solve the following problem:
Calculate the mean of a t...
Student's t density with ν degrees of freedom, Tν, is given by
f(x|v) = r(v+1/2)/r(v/2) (1/√vπ) (1+ x2/v)-(v+1)/2
Calculate the mean of a t distribution with ν = 4 degrees of freedom using a Metropolis- Hastings algorithm with candidate density
a. N (0, 1);
b. t with ν = 2 degrees of freedom.
In each case monitor the convergence across iterations.