tutorial based on
http://www.stat.pitt.edu/stoffer/tsa3/R_toot.htm