summaryrefslogtreecommitdiffstats
path: root/data/normality.py
diff options
context:
space:
mode:
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