summaryrefslogtreecommitdiffstats
path: root/data/normality.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-03-05 18:10:36 -0800
committerThibaut Horel <thibaut.horel@gmail.com>2012-03-05 18:10:36 -0800
commit538fca8c33267890d574ef0e9a7a5642ad793f36 (patch)
treec4fc587291e13b3028b4bff4843b3dcab9043b15 /data/normality.py
parentc6b28be394f2cab27500821f3325bafa9093ced4 (diff)
downloadkinect-538fca8c33267890d574ef0e9a7a5642ad793f36.tar.gz
Last code change in data processing, in case we need it for camera ready
Diffstat (limited to 'data/normality.py')
-rwxr-xr-xdata/normality.py5
1 files changed, 3 insertions, 2 deletions
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