The N-th order stationarity  of a random process is assessed using two tests. In the present submission, only the first and second-order stationarities are described. A random process is stationary at the first order if its mean does not change (significantly) with the time. Similarly, a random process is stationary at the second-order if its variance or standard deviation does not change (significantly) with the time.
The LiveScript example considers the case of turbulent velocity time histories. Their stationarity is assessed using two different approaches:
- A non-parametric test [2,3], which detects trends and classify the time as non-stationary if the trend is not negligible.
- A parametric test based on moving-window functions that compare the instantaneous mean or standard deviation to the one obtained without any detrending.
To run the examples, you will need some additional functions:
- randomProcess.m, available on https://se.mathworks.com/matlabcentral/fileexchange/76854-one-point-random-process-generation
- getSamplingPara.m, available on https://se.mathworks.com/matlabcentral/fileexchange/76854-one-point-random-process-generation
- binAveraging.m, available on https://se.mathworks.com/matlabcentral/fileexchange/73584-averaging-noisy-data-into-bins
The present submission contains:
- The function RA_test.m, which implements the reverse-arrangement test by Bendat and piersol but also Siegel et al 
- The function MW_test.m, which implement a parametric stationarity test relying on moving windows functions.
- A LiveScript example Documentation.mlx
 Priestley, M. B. (1981). Spectral Analysis and Time Series. Academic Press. ISBN 0-12-564922-3.
 Bendat and piersol, Random data, 2010, page 99
 Siegel, Sidney, and N. J. Castellan. "Non-para-metric statistics for the behavioral sciences." (1988).
E. Cheynet (2020). Stationarity test (https://github.com/ECheynet/stationaryTests/releases/tag/v1.2.1), GitHub. Retrieved .
E. Cheynet. ECheynet/StationaryTests: Sationarity Tests for Random Process. Zenodo, 2020, doi:10.5281/ZENODO.3891111.
the "rng(1)" is used to ensure the reproducibility of the examples. As far as I know, the default random number generator in the recent versions of Matlab is "twister". Therefore, writing "rng(1)" or "rng(1,'twister')" should produce the same results. In addition, there is no reason for the output of the function RA.m to be affected by the type of random number generator used, although the examples will not be perfectly reproduced in this case. Note that if you use an old Matlab version, e.g. MATLAB 4.0., the default random number generator is not "twister".
In Example, need to modify rng(1) to rng(1,'twister'). Otherwise works well.
See release notes for this release on GitHub: https://github.com/ECheynet/stationaryTests/releases/tag/v1.2.1
See release notes for this release on GitHub: https://github.com/ECheynet/stationaryTests/releases/tag/v1.2
function description + some debugging
-type + picture