def test_Z3():
  """ Test of implementation 2. """
  traj = simple_traj10()
  theta = np.array([500.0, -100.0])
  weights = [[0.1, 0.9], [0.9, 0.1]]
  elts = LearningElementsSecure(traj, theta, weights=weights)
  elts.computeLogZ()
def test_traj_1_2():
  """ test_traj_1_2 """
  traj = simple_traj1()
  theta = np.array([1.0, -1.0])
  choices = [1, 0]
  elts = LearningElementsSecure(traj, theta, choices)
  elts.computeLogZ()
  elts_ref = LearningElementsRef(traj, theta, choices)
  elts_ref.computeLogZ()
  assert(within(elts.Z, elts_ref.Z, 1e-5)), (elts.Z, elts_ref.Z, 1e-5)
  assert(within(elts.logZ, elts_ref.logZ, 1e-5)), \
    (elts.logZ, elts_ref.logZ, 1e-5)