0% found this document useful (0 votes)
47 views

Ass5 DLM Intro

This document provides instructions for an assignment on dynamic linear models using R. Students are asked to: 1) Use a Kalman filter to estimate filtering states and their standard deviations from Nile river flow data, and plot the results. 2) Compute one-step ahead forecasts from the data and plot with credible intervals. 3) Experiment with different signal-to-noise ratios by varying the observation and evolution variances, and comment on the effects.

Uploaded by

Assan Achibat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Ass5 DLM Intro

This document provides instructions for an assignment on dynamic linear models using R. Students are asked to: 1) Use a Kalman filter to estimate filtering states and their standard deviations from Nile river flow data, and plot the results. 2) Compute one-step ahead forecasts from the data and plot with credible intervals. 3) Experiment with different signal-to-noise ratios by varying the observation and evolution variances, and comment on the effects.

Uploaded by

Assan Achibat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Bocconi University. 20236  Time series analysis.

Assignment 5  Dynamic Linear Models with R  Part I:


Kalman lter for DLMs with known parameters.
Due by April 15, 2020

For these exercises, install and load package dlm.


For an overview: http://core.ac.uk/download/pdf/6340213.pdf

• Exercise.
Consider the Nile data (measurements of the annual ow of the river Nile at Ashwan 1871-1970),
available in R (> ?Nile).
First, plot the data. The series clearly appears non-stationary, presenting a quite evident change
point. A local level model, i.e. a random walk plus noise, can be used to capture the main change
point, and other minor changes in the level of the Nile river. Let us consider the following random
walk plus noise model

yt = θt + vt , vt ∼ N (0, 15100)
θt = θt−1 + wt , wt ∼ N (0, 1470)

where we xed V = 15100, W = 1470. In fact, the variances V and W will have to be estimated
(next assignment). As the initial distribution, let θ0 ∼ N (1000, 1000).

1. Compute and plot the ltering states


√ estimates mt = E(θt | y1:t ), for t = 1, 2, . . . , T .
Compute the standard deviations Ct = V (θt | y1:t )1/2 and plot them. Comment briey.
Finally, plot the data together with the ltering state estimates and their 0.95 credible inter-
vals.
2. Compute the one-step ahead forecasts ft = E(Yt | y1:t−1 ), t = 1, ..., T .
Plot the data, together the one-step-ahead forecasts and their 0.95 credible intervals.
3. What is the eect of the signal-to-noise ratio (i.e. the ratio W/V ) on the forecasts? Repeat
the exercise with dierent choices of V (observation variance) and W (evolution variance)
and comment briey.

You might also like