# How to call the average difference between successive values

In statistics when you have dataset of values say: $\{1,2,3,4,5,6,7,8,9,10\},$ the mean of differences between every two consecutive observations is $1$. For the dataset $\{1,2,6\}$, it is $2.5$. For $\{1,2,3\}$ it is $1$. For $\{1,2,4\},$ it is $1.5$.

Is there a name for this? Some people suggest "moving average," but I'm not sure.

• the mean of the sequences of differences ? – user451844 Aug 19 '17 at 20:22
• Not here to question your work, but did you notice that the mean between $a_{n+1}-a_n$ and $a_{n+2}-a_{n+1}$ is just $\dfrac{a_{n+2}-a_n}{2}$ ? (i.e. the fact that there is a number in between does not matter at all) – user228113 Aug 19 '17 at 20:22
• What would be the 'mean difference' values for datasets $\{1,1,7\}$ and $\{1,7,1\}$...? – CiaPan Aug 21 '17 at 5:46
• @CiaPan: Aha! You have noticed the importance of sorting the observations in ascending order. See my Answer. – BruceET Aug 21 '17 at 5:49

## 1 Answer

I'm not sure there is a special name for this. But @RoddyMcPhee has suggested something reasonable. (And I have another suggestion later.)

You may be interested to know that there are related functions in R statistical software. The function diff finds the differences between adjacent observations. The function mean finds the sample mean.

x = c(1,2,3,4,5,6,7,8,9,10)
d.x = diff(x); d.x
## 1 1 1 1 1 1 1 1 1
mean(d.x)
## 1


Notice that this method makes sense only if the values are sorted in increasing order.

Using the Comment by @G.Sassatelli, sorting is not necessary, but we do need to know the maximum and the minimum.

(max(x) - min(x))/(length(x)-1)
## 1


Here is a simulation of an application of your idea. We put 1000 observations at random into the interval $(0,1).$ Then sort them, and view the result as sequential arrival times of a process. The 'interarrival times' (times between successive arrivals) are very nearly distributed according to an exponential distribution with rate $\lambda = 1/1000.$ Accordingly, the mean of the interarrival times should be about $\mu = 1/\lambda = 0.001.$

y = runif(1000)        # generate 1000 obs from UNIF(0,1)
d.y = diff(sort(y))    # 999 interarrival times
mean(d.y)
## 0.0009988142        # aprx mean interarrival time, exact = 0.001


Here is a histogram of the inter-arrival times along with the density function of the exponential distribution with rate 1/1000. Therefore, in a situation like this where the sorted data values are viewed as interarrival times of a process, the terminology you may be looking for is mean interarrival time.

Note: I have to admit a small discrepancy in this example. Because the simulation forced there to be exactly 1000 arrivals in one unit of time, the (conditional) distribution of interarrival times is not exactly exponential. (However, a Kolmogorv-Smirnov goodness-of-fit test fails to detect the discrepancy, $\text{P-value }\approx 0.8.$)