联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Algorithm 算法作业Algorithm 算法作业

日期:2019-12-19 11:10

MSDS 596 Homework 10 Due November 28 2017

Notes. The lowest grade among all eleven homework will be dropped, so NO late submission will be

accepted. All homework assignment must be written on standard 8.5 by 11 paper and stapled together.

Computer generated output without detailed explanations and remarks will not receive any credit. You may

type out your answers, but make sure to use different fonts to distinguish your own words with computer

output. Only hard copies are accepted, except under special circumstances. For the simulation and data

analysis problems, keep the code you develop as you may be asked to present your work later.

1 (80 pts). Use scan("lt.txt") to read in the data from the file lt.txt, which is a vector of length 500.

Consider a local trend model for the data

yt = st + et, et ∼ N(0, 0.25);

st+1 = st + ηt, ηt ∼ N(0, 0.01), s0 ∼ N(0.2, 2.25).

Use your own program for part (a), (b), and (c).

(a) Write your own program to implement the Kalman filter. Calculate the exact log likelihood of the

data. [Hint. Use s1|0 = 0.2, and Σ1|0 = 2.26 as the initial values.]

(b) Plot the predicted state variables st|t−1 for 1 ≤ t ≤ T. Also plot the 95% confidence intervals

st|t−1 ± 2pΣt|t−1. Your plot should look similar to Figure 11.4 of the textbook.

(c) Plot the filtered state variables st|

for 1 ≤ t ≤ T. Also plot the 95% confidence intervals st|t±2pΣt|t.

(d) Pretend that you do not know σ2e and σ2η, but you do have the prior knowledge that s0 ∼ N(0.2, 2.25),

use the dlm package to find the MLE of σ2e and σ2η.

(e) Reproduce the plots of part (b) and (c), using the MLE you obtained from part (d). Also, plot the

smoothed state variable st|T , together with the 95% confidence intervals st|T ± 2

p

Σt|T , for every t.

(f) Repeat part (d), using the R function StructTS() with type="level".

2 (20 pts). Rewrite the model (1−.3B)(1−.5B)(1−.6B +.4B2

)(rt −1.3) = at in the original form without

using the back-shift operator B.

1


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp