# Simple random walk and sudden drift, how to detect the change?

I have got the following question relating to random walks. I would like to determine the moment when a random walk changes from being a simple random walk to start to drift at certain time. This sort of scenario could happen when temperatures start to rise or sea levels droppping. The idea is to detect that change as soon as possible. Clearly if the system is left to drift for a long time, it is fairly obvious it has changed from a given initial level (given by the simple random walk at the start), but I would like to know if it is possible to detect that change very quickly after it happens. What sort of analysis would be needed? Any suggestions greatly appreciated. Many thanks!!

Michael and whuber, I really appreciate your comments. My initial question was in fact related to Quality Control, as I am trying to model a CUSUM as a Random Walk: When the system is in-control, I see it as a simple random walk, when it starts to drift and eventually goes out-of-control, I see it as a drifting random walk. Thus my question as to how (and critically, how quickly) to detect this change from stationary to drifting within random walks. I can see it is not easy to detect the drift, specially when the drift is small due to the stochastic nature of the system. But I think the ARIMA idea will help me, I had not looked at this theory before and thank you for this advice. Mili.

-
Detecting a drift in a random walk is not easy. –  Michael Chernick Jun 29 '12 at 12:14
That's right, @Michael: but are you then implicitly agreeing that temperature or sea level series truly are "random walks"? I think the problem here is that the OP is using "random walk" in a nontechnical sense and perhaps really only means "stationary" or "nontrending." Mili, is that the case? –  whuber Jun 29 '12 at 14:37
@whuber I am just going by the OPs premise that it is a random walk. If mili intended something else i have no idea. If mili means that the process starts out stationary and then starts drifting then maybe fitting a stationary ARMA model would be a good approach and the drift could be detected in the residuals. The drift could also be interpreted as an intervention and modeled as a change in the series with an addition of a linear component. An automated program like AUTOBOX could fit the model and identify the time of the intervention. –  Michael Chernick Jun 29 '12 at 14:52
Mili, you will find several dozen closely related--and possibly helpful--threads by clicking on the change-point tag. Keywords for a general search of literature and software are "changepoint" (which refers to a sudden change) and "online" (which, in statistics, often refers to applying procedures to a steady stream of data). A related search term would be "quality control" and associated technical words such as "cusum" and "control chart." –  whuber Jun 29 '12 at 15:25
Michael, Whuber, How much of a "history" of data is needed to be able to use the AUTOBOX or ARIMA models suggested? –  mili Jun 30 '12 at 20:13