About this question

Wald-Wolfowitz Runs Test

Medium · statistical_analysis · Quant Researcher interview question · runs_test, wald_wolfowitz, randomness_test, market_efficiency, statistical_analysis

The Wald-Wolfowitz runs test is a non-parametric method for detecting non-randomness in a data sequence. In quantitative finance, it is applied to time series like asset returns to test for trending or mean-reverting behavior, which are deviations from the efficient-market hypothesis. The test evaluates randomness by counting the number of "runs," which are consecutive observations on the same side of the median. Task Implement the function runs_test(data) to perform the Wald-Wolfowitz runs tes