# Kolmogorov-Smirnov test

Is Kolmogorov-Smirnov test self-sufficient to prove normal distribution of a time series? And then test efficiency of a market?

-
I'm not sure that a normal distribution implies market efficiency. These are two different issues. –  chrisaycock Mar 18 at 15:21
Ok and then let's asssume that your time series has passed Kolmogorov-Smirnov test for normal distrubition, and then you manage to proove that the underlying process is a random walk (for example with Hurst Exponent Analysis) is that sufficient? –  user1673806 Mar 18 at 15:29
I believe Chris' point is that even if you can prove normality, how does this allow you to infer efficient markets? You can use a K-S-Test to do that, but it would not allow you to make statements about whether the market is an efficient one. –  phi Mar 18 at 15:53
The term efficient market, as I understand it, means that all security prices reflect the total sum of public knowledge. If that were true, then there would be no arbitrage opportunities. It seems like this would be an easy thing to disprove. –  chrisaycock Mar 18 at 16:09
From my point of view, efficient means normal distribution and randon walk. –  user1673806 Mar 18 at 16:11

I think that knowing that price of every asset is a random walk is not enough to say that the market is efficient. What if prices of asset y and asset z follow the same price as x plus some noise. If x is a random walk, then y and z are also random walks; however, it would be possible to exploit their relationship via pairs trading; hence, markets are not efficient. In my example x could price of oil and y and z could be two oil companies prices of who's shares are closely related to the price of oil.

Here is an illustration in Python:

import pylab
import random as rn

def gen_random_walk(n):
x = [100]
for _ in xrange(n):
change = rn.gauss(0, x[-1]/100.0)
x.append(x[-1] + change)
return x

def plot_pair(n):
x = gen_random_walk(n)
noise_y = [rn.gauss(0, 1) for _ in xrange(n)]
noise_z = [rn.gauss(0, 1) for _ in xrange(n)]

y = [ele_x + noise_y for ele_x, noise_y in zip(x, noise_y)]
z = [ele_z + noise_y for ele_z, noise_y in zip(x, noise_z)]

pylab.plot(zip(y,z))
pylab.show()

plot_pair(250)


-

Wikipedia says

In statistics, the Kolmogorov–Smirnov test (K–S test) is a nonparametric test for the equality of continuous, one-dimensional probability distributions that can be used to compare a sample with a reference probability distribution (one-sample K–S test), or to compare two samples (two-sample K–S test).

so yes but also warns that a large number of data points might be required. Why don't you apply the Jarque-Bera test?

I think I've a simpler example to show that a normal distribution does not imply market efficiency:

Suppose security 1 prices are given by the GBM $X(t)$ and the prices of security 2 $X(t-1)$. Then returns are normally distributed but predictable.

-
no. this test as same as any else can't say for 100% that distribution is normal. and how do you want to use it to test market efficiency? you didn't mention. basically to test market efficiency the CAPM or APT model is used. you can find here more info about it. in short it must holds that higher return correspond to higher $\beta$