def test_filter_ref_traj2_1(): """ test_filter_ref_traj2_1 """ traj = simple_traj2() theta = np.array([-1.0, 1.0]) for k in range(traj.L): filter_ref = TrajectoryFilterRef(traj, theta, k) filter_ref.computeProbs() filter_1 = TrajectoryFilter1(traj, theta, k) filter_1.computeProbs() check_probs(filter_1, filter_ref)
def test_filter_ref_traj1_1(): """ test_filter_ref_traj1_1 """ traj = simple_traj1() theta = np.array([-1.0, 1.0]) for k in range(traj.L): filter_ref = TrajectoryFilterRef(traj, theta, k) filter_ref.computeProbs() filter_1 = TrajectoryFilter1(traj, theta, k) filter_1.computeProbs() check_probs(filter_1, filter_ref)
def test_filter_ref_2(): """ test_filter_ref_2 """ traj = simple_traj2() theta = np.array([1.0, -1.0]) filter_0 = TrajectoryFilterRef(traj, theta, 0) filter_0.computeProbs() # The forward probabilities should equal the probabilities check_prob_fields(filter_0.forward, filter_0.probabilities) # Run the filter in inneficient smooting mode filter_L = TrajectoryFilterRef(traj, theta, traj.L) filter_L.computeProbs() smoother = TrajectorySmootherRef(traj, theta) smoother.computeProbs() check_prob_fields(filter_L.forward, smoother.forward) check_prob_fields(filter_L.backward, smoother.backward) check_prob_fields(filter_L.probabilities, smoother.probabilities)
def test_filter_ref_2(): """ test_filter_ref_2 """ traj = simple_traj2() theta = np.array([1.0, -1.0]) filter_0 = TrajectoryFilterRef(traj, theta, 0) filter_0.computeProbs() # The forward probabilities should equal the probabilities check_prob_fields(filter_0.forward, filter_0.probabilities) # Run the filter in inneficient smooting mode filter_L = TrajectoryFilterRef(traj, theta, traj.L) filter_L.computeProbs() smoother = TrajectorySmootherRef(traj, theta) smoother.computeProbs() check_prob_fields(filter_L.forward, smoother.forward) check_prob_fields(filter_L.backward, smoother.backward) check_prob_fields(filter_L.probabilities, smoother.probabilities)