Analytic value function for optimal regime-switching pairs trading rules · Study