# Stopping time

In probability theory, in particular in the study of stochastic processes, a stopping time (also Markov time, Markov moment, optional stopping time or optional time) is a specific type of "random time": a random variable whose value is interpreted as the time at which a given stochastic process exhibits a certain behavior of interest. A stopping time is often defined by a stopping rule, a mechanism for deciding whether to continue or stop a process on the basis of the present position and past events, and which will almost always lead to a decision to stop at some finite time.
Stopping times occur in decision theory, and the optional stopping theorem is an important result in this context. Stopping times are also frequently applied in mathematical proofs to "tame the continuum of time", as Chung put it in his book (1982).

## Definition
### Discrete time

Let $\tau$ be a random variable, which is defined on the filtered probability space $(\Omega ,{\mathcal {F}},({\mathcal {F}}_{n})_{n\in \mathbb {N} },P)$ with values in $\mathbb {N} \cup \{+\infty \}$. Then $\tau$ is called a stopping time (with respect to the filtration $\mathbb {F} =(({\mathcal {F}}_{n})_{n\in \mathbb {N} }$), if the following condition holds:
    $\{\tau =n\}\in {\mathcal {F}}_{n}$ for all $n$
Intuitively, this condition means that the "decision" of whether to stop at time $n$ must be based only on the information present at time $n$, not on any future information.

### General case

Let $\tau$ be a random variable, which is defined on the filtered probability space $(\Omega ,{\mathcal {F}},({\mathcal {F}}_{t})_{t\in T},P)$ with values in $T$. In most cases, $T=[0,+\infty )$. Then $\tau$ is called a stopping time (with respect to the filtration $\mathbb {F} =({\mathcal {F}}_{t})_{t\in T}$), if the following condition holds:
    $\{\tau \leq t\}\in {\mathcal {F}}_{t}$ for all $t\in T$

### As adapted process

Let $\tau$ be a random variable, which is defined on the filtered probability space $(\Omega ,{\mathcal {F}},({\mathcal {F}}_{t})_{t\in T},P)$ with values in $T$. Then $\tau$ is called a stopping time if the stochastic process $X=(X_{t})_{t\in T}$, defined by
    $X_{t}:={\begin{cases}1&{\text{ if }}t<\tau \\0&{\text{ if }}t\geq \tau \end{cases}}$
is adapted to the filtration $\mathbb {F} =({\mathcal {F}}_{t})_{t\in T}$

### Comments

Some authors explicitly exclude cases where $\tau$ can be $+\infty$, whereas other authors allow $\tau$ to take any value in the closure of $T$.

## Examples

To illustrate some examples of random times that are stopping rules and some that are not, consider a gambler playing roulette with a typical house edge, starting with $100 and betting $1 on red in each game:
* Playing exactly five games corresponds to the stopping time τ = 5, and is a stopping rule.
* Playing until they either run out of money or have played 500 games is a stopping rule.
* Playing until they obtain the maximum amount ahead they will ever be is not a stopping rule and does not provide a stopping time, as it requires information about the future as well as the present and past.
* Playing until they double their money (borrowing if necessary) is not a stopping rule, as there is a positive probability that they will never double their money.
* Playing until they either double their money or run out of money is a stopping rule, even though there is potentially no limit to the number of games they play, since the probability that they stop in a finite time is 1.
To illustrate the more general definition of stopping time, consider Brownian motion, which is a stochastic process $(B_{t})_{t\geq 0}$, where each $B_{t}$ is a random variable defined on the probability space $(\Omega ,{\mathcal {F}},\mathbb {P} )$. We define a filtration on this probability space by letting ${\mathcal {F}}_{t}$ be the σ-algebra generated by all the sets of the form $(B_{s})^{-1}(A)$ where $0\leq s\leq t$ and $A\subseteq \mathbb {R}$ is a Borel set. Intuitively, an event E is in ${\mathcal {F}}_{t}$ if and only if we can determine whether E is true or false just by observing the Brownian motion from time 0 to time t.
* Every constant $\tau :=t_{0}$ is (trivially) a stopping time; it corresponds to the stopping rule "stop at time $t_{0}$".
* Let $a\in \mathbb {R} .$ Then $\tau :=\inf\{t\geq 0\mid B_{t}=a\}$ is a stopping time for Brownian motion, corresponding to the stopping rule: "stop as soon as the Brownian motion hits the value a."
* Another stopping time is given by $\tau :=\inf\{t\geq 1\mid B_{s}>0{\text{ for all }}s\in [t-1,t]\}$. It corresponds to the stopping rule "stop as soon as the Brownian motion has been positive over a contiguous stretch of length 1 time unit."
* In general, if τ$_1$ and τ$_2$ are stopping times on $\left(\Omega ,{\mathcal {F}},\left\{{\mathcal {F}}_{t}\right\}_{t\geq 0},\mathbb {P} \right)$ then their minimum $\tau _{1}\wedge \tau _{2}$, their maximum $\tau _{1}\vee \tau _{2}$, and their sum τ$_1$ + τ$_2$ are also stopping times. (This is not true for differences and products, because these may require "looking into the future" to determine when to stop.)
Hitting times like the second example above can be important examples of stopping times. While it is relatively straightforward to show that essentially all stopping times are hitting times, it can be much more difficult to show that a certain hitting time is a stopping time. The latter types of results are known as the Début theorem.

## Localization

Stopping times are frequently used to generalize certain properties of stochastic processes to situations in which the required property is satisfied in only a local sense. First, if X is a process and τ is a stopping time, then X$^τ$ is used to denote the process X stopped at time τ.
    $X_{t}^{\tau }=X_{\min(t,\tau )}$
Then, X is said to locally satisfy some property P if there exists a sequence of stopping times τ$_n$, which increases to infinity and for which the processes
    $\mathbf {1} _{\{\tau _{n}>0\}}X^{\tau _{n}}$
satisfy property P. Common examples, with time index set I = [0, ∞), are as follows:
   Local martingale process. A process X is a local martingale if it is càdlàg and there exists a sequence of stopping times τ$_n$ increasing to infinity, such that
       $\mathbf {1} _{\{\tau _{n}>0\}}X^{\tau _{n}}$
   is a martingale for each n.
   Locally integrable process. A non-negative and increasing process X is locally integrable if there exists a sequence of stopping times τ$_n$ increasing to infinity, such that
       $\operatorname {E} \left[\mathbf {1} _{\{\tau _{n}>0\}}X^{\tau _{n}}\right]<\infty$
   for each n.

## Types of stopping times

Stopping times, with time index set I = [0,∞), are often divided into one of several types depending on whether it is possible to predict when they are about to occur.
A stopping time τ is predictable if it is equal to the limit of an increasing sequence of stopping times τ$_n$ satisfying τ$_n$ < τ whenever τ > 0. The sequence τ$_n$ is said to announce τ, and predictable stopping times are sometimes known as announceable. Examples of predictable stopping times are hitting times of continuous and adapted processes. If τ is the first time at which a continuous and real valued process X is equal to some value a, then it is announced by the sequence τ$_n$, where τ$_n$ is the first time at which X is within a distance of 1/n of a.
Accessible stopping times are those that can be covered by a sequence of predictable times. That is, stopping time τ is accessible if, P(τ = τ$_n$ for some n) = 1, where τ$_n$ are predictable times.
A stopping time τ is totally inaccessible if it can never be announced by an increasing sequence of stopping times. Equivalently, P(τ = σ < ∞) = 0 for every predictable time σ. Examples of totally inaccessible stopping times include the jump times of Poisson processes.
Every stopping time τ can be uniquely decomposed into an accessible and totally inaccessible time. That is, there exists a unique accessible stopping time σ and totally inaccessible time υ such that τ = σ whenever σ < ∞, τ = υ whenever υ < ∞, and τ = ∞ whenever σ = υ = ∞. Note that in the statement of this decomposition result, stopping times do not have to be almost surely finite, and can equal ∞.

## Stopping rules in clinical trials

Clinical trials in medicine often perform interim analysis, in order to determine whether the trial has already met its endpoints. However, interim analysis create the risk of false-positive results, and therefore stopping boundaries are used to determine the number and timing of interim analysis (also known as alpha-spending, to denote the rate of false positives). At each of R interim tests, the trial is stopped if the likelihood is below a threshold p, which depends on the method used. See Sequential analysis.