diff options
| author | Jon Whiteaker <jbw@berkeley.edu> | 2012-03-15 15:56:21 -0700 |
|---|---|---|
| committer | Jon Whiteaker <jbw@berkeley.edu> | 2012-03-15 15:56:21 -0700 |
| commit | ff1e46e5bfa8ba1aad2f8f11aa3b701ac76a3847 (patch) | |
| tree | 86db7d7d37d08f06dc91231356276515bfea3f58 /data/normality.py | |
| parent | 12dd14cb9b2cf2d120fe1e76e28a5b97996af137 (diff) | |
| parent | 538fca8c33267890d574ef0e9a7a5642ad793f36 (diff) | |
| download | kinect-ff1e46e5bfa8ba1aad2f8f11aa3b701ac76a3847.tar.gz | |
Merge branch 'master' of paloalto.thlab.net:kinect-eccv12
Diffstat (limited to 'data/normality.py')
| -rwxr-xr-x | data/normality.py | 5 |
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 |
