What is the difference between first order difference and moving average? I am doing a time-series classification problem where I recently came accross the concepts;


*

*moving average

*first order difference


I know how to compute the aforementioned two types in time-series. However, what I am still not clear is the difference of these two outputs.
What are similarities and differences of moving average and first order difference?
I am happy to provide more details if needed.
 A: Suppose you have a set of time-series data values $x_1,...,x_n$.  For some value $k<n$ in the series, the corresponding moving average over $k$ periods up to time $t$ is:
$$\bar{x}_{t}^{(k)} = \frac{1}{k} \sum_{i=0}^{k-1} x_{t-i}.$$
As you change the last time period $t$ you move the average to be an average over different values (but always over $k$ consecutive values).  This means that you get a running sequence of moving averages $\bar{x}_{k}^{(k)}, ..., \bar{x}_{n}^{(k)}$ where each average is over $k$ consecutive values.  This "moving average" generally gives you a sense of how the series is changing, but in a "smoothed" fashion.

Now, first-order differences are a different thing to this.  The (backwards) first-order differences are the values:
$$\nabla x_t = x_t - x_{t-1}.$$
By taking the first-order differences at different time points you get a sequence of differences $\nabla x_2, ..., \nabla x_n$ that show how the time-series is changing each period.

The moving average and the first-order difference are two different things, but it is useful to note that they can be interacted with each other in useful ways.  For example, if we take the first-order difference of the moving average, we get:
$$\begin{equation} \begin{aligned}
\nabla \bar{x}_{t}^{(k)} 
&= \bar{x}_{t,k} - \bar{x}_{t-1,k} \\[6pt]
&= \frac{1}{k} \sum_{i=0}^{k-1} x_{t-i} - \frac{1}{k} \sum_{i=0}^{k-1} x_{t-i-1} \\[6pt]
&= \frac{1}{k} \Bigg( \sum_{i=0}^{k-1} x_{t-i} - \sum_{i=1}^{k} x_{t-i} \Bigg) \\[6pt]
&= \frac{1}{k} ( x_{t} - x_{t-k} ) \\[6pt]
&= \frac{\nabla_k}{k} x_{t}. \\[6pt]
\end{aligned} \end{equation}$$
We can see that this is $1/k$ times the $k$-level difference of the series values (which is a useful demonstration of the fact that using the moving average causes the changes in the values to be "smoothed").
A: First I talk about first order difference
First order difference: To run  most time series regressions stationary is essential condition. If your data is not stationary then we use differencing.When we deduct present observation from it's lag it's called first order difference. To run whether MA or AR or ARMA you should first ensure stationary.
Moving Average: Moving average is used when your time series suffers from auto-correlation. It is basically a regression technique in which you regress the error term of the model with its lag. If you regress it with first lag we call it MA(1). If second we call MA(2) and so on. 
