Manh mối trong câu trả lời của tôi cho câu trả lời trước đó là xem cách tôi tích hợp các tham số - bởi vì bạn sẽ thực hiện chính xác các tích phân tương tự ở đây. Câu hỏi của bạn giả định các tham số phương sai đã biết, vì vậy chúng là hằng số. Bạn chỉ cần nhìn vào phụ thuộc vào tử số. Để thấy điều này, lưu ý rằng chúng ta có thể viết:α,μ
p(μ,α|Y)=p(μ,α)p(Y|μ,α)∫∫p(μ,α)p(Y|μ,α)dμdα
=1(2πσ2e)5⋅2πσ2pexp[−12σ2e∑11i=2(Yi−μ−α⋅Yi−1)2−μ22σ2p−α22σ2p]∫∫1(2πσ2e)5⋅2πσ2pexp[−12σ2e∑11i=2(Yi−μ−α⋅Yi−1)2−μ22σ2p−α22σ2p]dμdα
1(2πσ2e)5⋅2πσ2pexp[−12σ2e∑11i=2Y2i] and it will also cancel. The integral we are left with is now (after expanding the squared term):
=exp[−10μ2+α2∑10i=1Y2i−2μ∑11i=2Yi−2α∑11i=2YiYi−1+2μα∑10i=1Yi2σ2e−μ22σ2p−α22σ2p]∫∫exp[−10μ2+α2∑10i=1Y2i−2μ∑11i=2Yi−2α∑11i=2YiYi−1+2μα∑10i=1Yi2σ2e−μ22σ2p−α22σ2p]dμdα
Now we can use a general result from the normal pdf.
∫exp(−az2+bz−c)dz=πa−−√exp(b24a−c)
This follows from completing the square on
−az2+bz and noting that
c does not depend on
z. Note that the inner integral over
μ is of this form with
a=102σ2e+12σ2p and
b=∑11i=2Yi−α∑10i=1Yiσ2e and
c=α2∑10i=1Y2i−2α∑11i=2YiYi−12σ2e+α22σ2p. After doing this integral, you will find that the remaining integral over
α is also of this form, so you can use this formula again, with a different
a,b,c. Then you should be able to write your posterior in the form
12π|V|12exp[−12(μ−μ^,α−α^)V−1(μ−μ^,α−α^)T] where
V is a
2×2 matrix
Let me know if you need more clues.
update
(note: correct formula, should be 10μ2 instead of μ2)
if we look at the quadratic form you've written in the update, we notice there is 5 coefficients (L is irrelevant for posterior as we can always add any constant which will cancel in the denominator). We also have 5 unknowns μ^,α^,Q11,Q12=Q21,Q22. Hence this is a "well posed" problem so long as the equations are linearly independent. If we expand the quadratic (μ−μ^,α−α^)Q(μ−μ^,α−α^)t we get:
Q11(μ−μ^)2+Q22(α−α^)2+2Q12(μ−μ^)(α−α^)
=Q11μ2+2Q21μα+Q22α2−(2Q11μ^+2Q12α^)μ−(2Q22α^+2Q12μ^)α+
+Q11μ^2+Q22α^2+2Q12μ^α^
Comparing second order coefficient we get A=Q11,B=2Q12,C=Q22 which tells us what the (inverse) covariance matrix looks like. Also we have two slightly more complicated equations for α^,μ^ after substituting for Q. These can be written in matrix form as:
−(2ABB2C)(μ^α^)=(JK)
Thus the estimates are given by:
(μ^α^)=−(2ABB2C)−1(JK)=14AC−B2(BK−2JCBJ−2KA)
Showing that we do not have unique estimates unless 4AC≠B2. Now we have:
A=102σ2e+12σ2pJ=−∑11i=2Yiσ2eB=∑10i=1Yiσ2eK=−∑11i=2YiYi−1σ2eC=∑10i=1Y2i2σ2e+12σ2p
Note that if we define Xi=Yi−1 for i=2,…,11 and take the limit σ2p→∞ then the estimates for μ,α are given by the usual least squares estimate α^=∑11i=2(Yi−Y¯¯¯¯)(Xi−X¯¯¯¯¯)∑11i=2(Xi−X¯¯¯¯¯)2 and μ^=Y¯¯¯¯−α^X¯¯¯¯ where Y¯¯¯¯=110∑11i=2Yi and X¯¯¯¯=110∑11i=2Xi=110∑10i=1Yi. So the posterior estimates are a weighted average between the OLS estimates and the prior estimate (0,0).