# Find sudden change or high variation in a dynamic real-time stream of real continuous number

I have a stream of real continuous numbers (Figure. 1). The stream flows from left to right. At $t_1$ the first number entered the stream. Every time a new number enters the stream I check if there is a sudden change or high variation.

How can I compute the sudden change or high variation without using any threshold. The following picture is just and example.

What I was doing is simply compute a quantity $Q_x = |t_4 - t_5|$ and if $Q_x > \delta$ then there is a sudden change and a high variation. Using a threshold is wrong in my situation because there is no bound for the real numbers in the stream. Another idea came to my mind which is the following:

$if\;|t_5-t_4| >|t_4-t_3| + \delta$ where $\delta = [0,1]$ then there is a sudden change.

What do you think? Thank you.

• @haxan7, let's say you have the simplest model: you think that the process tends to generate numbers around the constant $c$: $x_t=c+\varepsilon_t$, where $\varepsilon_t$ is the random error. Let's say in the next period you got $x_{t+1}$. You compute the deviation $e_{t+1}=x_{t+1}-c$. If you knew the variance of the error $\sigma_\varepsilon^2$, you could compare the deviation $e_{t+1}$ against the variance. For instance, assuming the errors are normal, there's less than 5% chance to have $|e_{t+1}|>1.96\sigma_\varepsilon$, so you could call this a sudden change. – Aksakal Sep 29 '15 at 15:15