A couple functions to set up the time-series model