stan-dev/stan — pull request #132 by jrnold (2013-06-22 03:28:18+00:00)
Title: Gaussian Dynamic Linear Model distribution

This branch adds distribution functions for Gaussian Dynamic Linear models. The merge includes the density function, unit tests, and three example models.

The probability density function has two signatures. When `V` is a vector it uses a more computationally efficient method to calculate the likelihood.

There are a couple of things that I couldn't figure out or they required me altering code in parts of the project that I didn't feel comfortable messing with.

- I have the prior mean and variance of the initial state hard coded to a diffuse distribution. I haven't included them as arguments yet because then `gaussian_dlm_log` would have 7 args while `boost::math::tools::promote_args` only supports 6 args, and `function_signatures::add` only supports up to 5 args.
- It only supports constant system matrices `F`, `G`, `V`, and `W` because time-varying arguments would require defining the function for vectors of matrices and I didn't see any other functions that have done that.