Starting from:

$29.99

STA360-602 Homework 8 Solution


General instructions for homeworks: Please follow the uploading file instructions according to the syllabus. You will give the commands to answer each question in its own code block, which will also produce plots that will be automatically embedded in the output file. Each answer must be supported by written statements as well as any code used. Your code must be completely reproducible and must compile. Syllabus: (https://github.com/resteorts/modernbayes/blob/master/syllabus/syllabus-sta602-spring19.pdf)
Commenting code Code should be commented. See the Google style guide for questions regarding commenting or how to write code https://google.
github.io/styleguide/Rguide.xml. No late homework’s will be accepted.
1. Lab component (10 points) Please complete Lab 10, parts c and d which correspond with linear regression, which can be found here: https:// github.com/resteorts/modern-bayes/blob/master/labs/10-linear-regression/ 11-linear-regression_v2.pdf. It is highly recommend that you work through parts (a) and (b) on your own and derive these as these are excellent practice exercises for the exam. You can check your own work on this.
c) (5 points) Complete lab 10, part c.
d) (5 points) Complete lab 10, part d.
1
2. Extra Credit (8 points) Multivariate Methods This problem is optional for the homework, but it is worth extra credit. It is also a type of problem that is reasonable to appear on the final exam, and it’s similar to what we did in class regarding the multivariate normal distribution.
Consider the following hierarchical model:
yi | θ,Σ i.i.d.∼ MV N(θd×1,Σd×d), i = 1,··· ,n,
and independent priors
θd×1 ∼ MV N(µd×1,Td×d), Σd×d ∼ inverseWishart(ν, .
(a) (1 point) Show that (θTT−1µ)T = µTT−1θ. Hint: what’s the transpose of a scalar?
(b) (1 point) Use (a) to show that:

(c) (2 points) Use (b) to show that
.
(d) (2 points) Show that:
tr(Ψ .
Hint: Recall that tr(A) is the trace of matrix A – the sum of its diagonal entries. Lemma: (i) for scalar a, tr(a) = a; (ii) tr(ABC) = tr(BCA) = tr(CAB).
(e) (2 points) Use (d) to show (step-by-step) that:
[Σ|θ,data]
where ν∗ = n + v and Ψ .
2

More products