I bet @jessegrabowski can give you some pointers, including looking at the pymc-experimental statespace module