File Exchange

image thumbnail

Stationarity test

version (186 KB) by E. Cheynet
The stationarity of a time series is evaluated by using the reverse arrangement test.


Updated 28 May 2016

View License

The reverse arrangement test was first introduced by [1]. The following examples are directly inspired from [2] and [3] where the stationarity of a signal is investigated. More specifically, the test evaluates the existence of a non-negligible trend. Only the 95% confidence interval is used here. All the credit go to the authors for the original methods.
[1] Julius S. Bendat, Allan G. Piersol, Random Data: Analysis and Measurement Procedures, 4th Edition; ISBN: 978-0-470-24877-5
[2] Homayon Aryan, Keith Yearby, Michael Balikhin, Oleksiy Agapitov, Vladimir Krasnoselskikh, Richard Boynton, Statistical study of chorus wave distributions in the inner magnetosphere usingAeand solar wind parameters, Journal of Geophysical Research: Space Physics, 2014, 119, 8, 6131
[3] Travis W. Beck, Terry J. Housh, Joseph P. Weir, Joel T. Cramer, Vassilios Vardaxis, Glen O. Johnson, Jared W. Coburn, Moh H. Malek, Michelle Mielke, An examination of the Runs Test, Reverse Arrangements Test, and modified Reverse Arrangements Test for assessing surface EMG signal stationarity, Journal of Neuroscience Methods, Volume 156, Issues 1–2, 30 September 2006, Pages 242-248, ISSN 0165-0270,

Comments and Ratings (3)

Fuad Numan

E. Cheynet

Hi TideMan,
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.



function description + some debugging


-doi updated

-type + picture

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux