コード例 #1
0
 def test_log_pdf_2n_2d(self):
     mu = asarray([0, 1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[1, 1], [0, 1]], dtype=numpy.bool8)
     result = dist.log_pdf(X)
     expected = zeros(2) + numpy.nan
コード例 #2
0
 def test_log_pdf_returned_array_dimension_multiple_X_2d(self):
     n = 2
     mu = asarray([0, 1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[1, 0], [0, 0]], dtype=numpy.bool8)
     self.assertEqual(dist.log_pdf(X).shape, (n, ))
コード例 #3
0
 def test_log_pdf_1n_1d_del(self):
     mu = asarray([1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     result = dist.log_pdf(X)
     expected = zeros(1) + numpy.nan
コード例 #4
0
 def test_log_pdf_2n_2d(self):
     mu = asarray([0, 1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[1, 1], [0, 1]], dtype=numpy.bool8)
     result = dist.log_pdf(X)
     expected = zeros(2) + numpy.nan
コード例 #5
0
 def test_log_pdf_returned_array_dimension_1d_X(self):
     n = 1
     mu = asarray([0], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     self.assertEqual(dist.log_pdf(X).shape, (n, ))
コード例 #6
0
 def test_log_pdf_1n_1d_del(self):
     mu = asarray([1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     result = dist.log_pdf(X)
     expected = zeros(1) + numpy.nan
コード例 #7
0
 def test_log_pdf_returned_array_dimension_multiple_X_2d(self):
     n = 2
     mu = asarray([0, 1], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[1, 0], [0, 0]], dtype=numpy.bool8)
     self.assertEqual(dist.log_pdf(X).shape, (n,))
コード例 #8
0
 def test_log_pdf_returned_array_dimension_1d_X(self):
     n = 1
     mu = asarray([0], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     self.assertEqual(dist.log_pdf(X).shape, (n,))
コード例 #9
0
 def test_log_pdf_type(self):
     mu = asarray([0], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     self.assertEqual(type(dist.log_pdf(X)), numpy.ndarray)
コード例 #10
0
 def test_log_pdf_type(self):
     mu = asarray([0], dtype=numpy.bool8)
     spread = .5
     dist = AddDelSwapProposal(mu, spread)
     X = asarray([[0]], dtype=numpy.bool8)
     self.assertEqual(type(dist.log_pdf(X)), numpy.ndarray)