Testing Stationarity and Change Point Detection in Reinforcement Learning
Mengbing Li, Chengchun Shi, Zhenke Wu, Piotr Fryzlewicz
TL;DR
This work tackles nonstationarity in offline reinforcement learning by developing a statistically principled test for the stationarity of the optimal Q-function $Q^{opt}$ using pre-collected data. It introduces three model-free test statistics based on estimated Q-functions, a multiplier bootstrap for critical values, and a change-point detection procedure to identify the most recent stationary segment for online policy learning. The authors prove consistency and derive finite-sample properties, validate performance via simulations and a real-world Intern Health Study application, and provide a Python implementation. The approach enables robust policy optimization in nonstationary environments and can be integrated with existing RL methods to adapt to evolving dynamics in domains like mHealth and healthcare monitoring.
Abstract
We consider offline reinforcement learning (RL) methods in possibly nonstationary environments. Many existing RL algorithms in the literature rely on the stationarity assumption that requires the system transition and the reward function to be constant over time. However, the stationarity assumption is restrictive in practice and is likely to be violated in a number of applications, including traffic signal control, robotics and mobile health. In this paper, we develop a consistent procedure to test the nonstationarity of the optimal Q-function based on pre-collected historical data, without additional online data collection. Based on the proposed test, we further develop a sequential change point detection method that can be naturally coupled with existing state-of-the-art RL methods for policy optimization in nonstationary environments. The usefulness of our method is illustrated by theoretical results, simulation studies, and a real data example from the 2018 Intern Health Study. A Python implementation of the proposed procedure is available at https://github.com/limengbinggz/CUSUM-RL.
