Stat4DS Homework #2 Solved

30.00 $

Category:

Description

5/5 - (1 vote)

1a) Illustrate the characteristics of the statistical model for dealing with the Dugong’s data [data available in the R code 2022-W-13-R2jags-code.R]. Lengths (Yi) and ages (xi) of 27 dugongs (see cows) captured off the coast of Queensland have been recorded and the following (non linear) regression model is considered in Carlin and Gelfand (1991):

Yi ∼ N(μi,τ2) μi=f(xi) = α−βγxi

Model parameters are α ∈ (1, ∞), β ∈ (1, ∞), γ ∈ (0, 1), τ 2 ∈ (0, ∞). Let us consider the following prior distributions:

α ∼ N(0,σα2) β ∼ N(0,σβ2)
γ ∼ Unif(0,1)

τ2 ∼ IG(a,b))(InverseGamma) 1b) Derive the corresponding likelihood function

1c) Write down the expression of the joint prior distribution of the parameters at stake and illustrate your suitable choice for the hyperparameters.

1d) Derive the functional form (up to proportionality constants) of all full-conditionals
1e) Which distribution can you recognize within standard parametric families so that direct simulation from

full conditional can be easily implemented ?

1f) Using a suitable Metropolis-within-Gibbs algorithm simulate a Markov chain (T = 10000) to approximate the posterior distribution for the above model

1g) Show the 4 univariate trace-plots of the simulations of each parameter
1h) Evaluate graphically the behaviour of the empirical averages Iˆ with growing t = 1, …, T

1i) Provide estimates for each parameter together with the approximation error and explain how you have evaluated such error

1l) Which parameter has the largest posterior uncertainty? How did you measure it? 1m) Which couple of parameters has the largest correlation (in absolute value)?

1

t

1n) Use the Markov chain to approximate the posterior predictive distribution of the length of a dugong with age of 20 years.

1o) Provide the prediction of a different dugong with age 30
1p) Which prediction is less precise?
(write your answers and provide your R code for the numerical solution)

Test #01

# # # # # # # # #

2

transition

We can gain some insight by drawing a picture:

3

2/3 1/4

1/2

Example: A frog hopping on 3 rocks. Put S = {1, 2, 3}.

011 22

511
P =  8 8 4 

210 33

Test #01

2) Let us consider a Markov chain (Xt)t≥0 defined on the state space S = {1,2,3} with the following

1/2

1/3

12

5/8

1/8

2a) Starting at time t = 0 in the state X 0

for t = 1000 consecutive times

= 1 simulate the Markov chain with distribution assigned as above

2b) compute the empirical relative frequency of the two states in your simulation 2c) repeat the simulation for 500 times and record only the final state at time t = 1000 for each of the 500 simulated chains. Compute the relative frequency of the 500 final states. What distribution are you approximating in this way?
Try to formalize the difference between this point and the previous point.

2d) compute the theoretical stationary distribution π and explain how you have obtained it
2e) is it well approximated by the simulated empirical relative frequencies computed in (b) and (c)? 2f)whathappensifwestartatt=0fromstateX0 =2insteadofX0 =1?

Markov Chains: An Introduction/Review — MASCOS Workshop on Markov Chains, April 2005 – p. 7

# # # # # # # # #

## This homework will be graded and it will be part of your final evaluation
##
##
## Last update by LT: Fri May 27 06:06:15 2022

3

  • HW-002-ovfna3.zip