From 538fca8c33267890d574ef0e9a7a5642ad793f36 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Mon, 5 Mar 2012 18:10:36 -0800 Subject: Last code change in data processing, in case we need it for camera ready --- data/normality.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'data/normality.py') diff --git a/data/normality.py b/data/normality.py index eb22553..3fb0fe7 100755 --- a/data/normality.py +++ b/data/normality.py @@ -1,3 +1,4 @@ +#! /usr/bin/python import sys import numpy as np from scipy.stats import lognorm @@ -8,7 +9,7 @@ def normtest(x): s = np.matrix(np.cov(x,bias=1,rowvar=0)) n,p = x.shape dift = x - np.mean(x,axis=0) - dj = np.diag(dift*s.I*dift.T) + dj = np.matrix(np.diag(dift*s.I*dift.T)) y = x*s.I*x.T djk = - 2*y.T + np.diag(y.T).T*np.ones((1,n)) + np.ones((n,1))*np.diag(y.T) b = 1/(math.sqrt(2))*((2*p + 1)/4)**(1/(p + 4))*(n**(1/(p + 4))) @@ -35,6 +36,6 @@ def normtest(x): if __name__ == "__main__": filename = sys.argv[1] x = np.loadtxt(filename,delimiter=",") - x = x[:10,7:] + x = x[:6000,7:] p = normtest(x) print p -- cgit v1.2.3-70-g09d2