Human and Machine Learning

Due 12/14/2015

The
goal of this assignment is to gain some
experience with models that deal with sequential or temporal
data.

Generate
a time series using a special case of a
linear dynamical system that is similar to an autoregressive model in
the time series literature.The hidden state of the dynamical system
will be a vector with 2 elements, which evolve over time according to:

y_{2}(t)
= y_{1}(t-1)
+ μ_{1}

y_{1}(t)
= α_{1}
y_{1}(t-1)
+ α_{2}
y_{2}(t-1)
+ μ_{2}

The observation will be a scalar:

z(t) = y_{1}(t)
+ μ_{3}

where for i={1,2,3}, μ_{i}
~ Normal(0,σ^{2})
and you should pick {α_{1,}α_{2}, σ}
to obtain interesting dynamics.

Plot a couple hundred points that are representative of this process.

y

y

The observation will be a scalar:

z(t) = y

where for i={1,2,3}, μ

Plot a couple hundred points that are representative of this process.

Turn
your model into a switched linear dynamical
system with 3 modes.
Each mode has an associated set of {α_{1,}α_{2}}
parameters.

Switching is memoryless, i.e., at each time with some small probability β, the mode m, is re-drawn from the set {1,2,3} with uniform probability.

Draw a graphical model that depicts this switched dynamical system. Show the conditional distributions on each arc, e.g., write out the transition table for P(m(t) | m(t-1))

Generate a nice graph illustrating the switching dynamics.

Switching is memoryless, i.e., at each time with some small probability β, the mode m, is re-drawn from the set {1,2,3} with uniform probability.

Draw a graphical model that depicts this switched dynamical system. Show the conditional distributions on each arc, e.g., write out the transition table for P(m(t) | m(t-1))

Generate a nice graph illustrating the switching dynamics.

Now
try to perform inference using the data set
you generated in either part 1 or part 2.

If you use the data set from part 1, then you can model it with a Kalman filter. Implement a KF (it's just a few lines of code in matlab) or find a toolbox and plot a portion of the time series along with the posterior predictive distribution. The posterior predictive distribution is P(z(t+1) | z(1), ..., z(t)). Since this distribution is Gaussian, plot the mean and some representation of uncertainty (e.g., lines at +/- 2 SD, or the shaded representation one sometimes sees.)

If you use the data set from part 2, you could be ambitious and use a particle filter to perform inference, in which case you'll obtain a set of samples that represent the posterior predictive distribution. Or you could try using a model that isn't quite up to the task, e.g., an HMM with a Gaussian observation model (i.e., each state of the HMM outputs a constant value corrupted by Gaussian noise). You'd have to train the HMM, and it would require more than 3 states, since each state represents a constant level, but it would be interesting to see how poorly it models the data.

If you use the data set from part 1, then you can model it with a Kalman filter. Implement a KF (it's just a few lines of code in matlab) or find a toolbox and plot a portion of the time series along with the posterior predictive distribution. The posterior predictive distribution is P(z(t+1) | z(1), ..., z(t)). Since this distribution is Gaussian, plot the mean and some representation of uncertainty (e.g., lines at +/- 2 SD, or the shaded representation one sometimes sees.)

If you use the data set from part 2, you could be ambitious and use a particle filter to perform inference, in which case you'll obtain a set of samples that represent the posterior predictive distribution. Or you could try using a model that isn't quite up to the task, e.g., an HMM with a Gaussian observation model (i.e., each state of the HMM outputs a constant value corrupted by Gaussian noise). You'd have to train the HMM, and it would require more than 3 states, since each state represents a constant level, but it would be interesting to see how poorly it models the data.