コード例 #1
0
ファイル: test_jackknife.py プロジェクト: josephepowell/ldsc
	def test_asymmetric(self):
		x = np.matrix(np.ones((10,2)))
		w = np.matrix(np.arange(10)+1 ).T
		wp = np.sqrt(w / float(np.sum(w)))
		correct_x = np.hstack((wp,wp))
		print jk._weight(x, w)
		print correct_x
		assert np.all(np.abs(jk._weight(x, w) - correct_x) < 1e-6)
コード例 #2
0
 def test_asymmetric(self):
     x = np.matrix(np.ones((10, 2)))
     w = np.matrix(np.arange(10) + 1).T
     wp = np.sqrt(w / float(np.sum(w)))
     correct_x = np.hstack((wp, wp))
     print jk._weight(x, w)
     print correct_x
     assert np.all(np.abs(jk._weight(x, w) - correct_x) < 1e-6)
コード例 #3
0
ファイル: test_jackknife.py プロジェクト: josephepowell/ldsc
	def test_symmetric(self):
		x = np.matrix(np.ones((2,2)))
		w = np.matrix((0.25,0.75)).T
		correct_x = np.matrix(( (0.5, 0.5), (0.8660254, 0.8660254)) )
		print jk._weight(x, w)
		assert np.all(np.abs(jk._weight(x, w) - correct_x) < 1e-6)
コード例 #4
0
 def test_symmetric(self):
     x = np.matrix(np.ones((2, 2)))
     w = np.matrix((0.25, 0.75)).T
     correct_x = np.matrix(((0.5, 0.5), (0.8660254, 0.8660254)))
     print jk._weight(x, w)
     assert np.all(np.abs(jk._weight(x, w) - correct_x) < 1e-6)