This is a paper by Box and Tiao from American Statistics Association.
It was a lot fun writing math equations in Lyx, which is a document processor which include not only restricted to Latex.
When I looked at the responses to step and pulse input, it really solves the puzzle, it reminded me of the my sophomore class.