コード例 #1
0
def perform_estimation(residuals, tracker, map_estimate):
    residuals = residuals - np.average(residuals, axis=0)
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R_ml = estimate_noise_ukf_ml(correlation[0], tracker.Pz)
    R_scaled = estimate_noise_ukf_scaling(correlation[0], tracker.Pz, tracker.R)
    R_map = map_estimate
    truth = R_proto * sim_var
    error_ml = matrix_error(R_ml, truth)
    error_scaled = matrix_error(R_scaled, truth)
    error_map = matrix_error(R_map, truth)

    # truth_norm = matrix_error(truth, 0)
    # print("Truth")
    # print(truth)
    # print("ML:")
    # print("", R_ml)
    # print("\tRelative error: %.6f" % (error_ml / truth_norm))
    # print("Scaled:")
    # print("", R_scaled)
    # print("\tRelative error: %.6f" % (error_scaled / truth_norm))
    # print("MAP:")
    # print("", R_map)
    # print("\tRelative error: %.6f" % (error_map / truth_norm))

    return error_ml, error_scaled, error_map
コード例 #2
0
def perform_estimation(residuals, tracker,
                       map_estimate, map_estimate_convergence):
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R_ml = estimate_noise_ukf_ml(correlation[0], tracker.Pz)
    R_scaled = estimate_noise_ukf_scaling(correlation[0], tracker.Pz, tracker.R)
    R_map = map_estimate
    R_map_conv = map_estimate_convergence
    truth = R_proto * measurement_var
    error_ml = matrix_error(R_ml, truth)
    error_scaled = matrix_error(R_scaled, truth)
    error_map = matrix_error(R_map, truth)
    error_map_conv = matrix_error(R_map_conv, truth)

    # truth_norm = matrix_error(truth, 0)
    # print("Truth")
    # print(truth)
    # print("ML:")
    # print("", R_ml)
    # print("\tRelative error: %.6f" % (error_ml / truth_norm))
    # print("Scaled:")
    # print("", R_scaled)
    # print("\tRelative error: %.6f" % (error_scaled / truth_norm))
    # print("MAP:")
    # print("", R_map)
    # print("\tRelative error: %.6f" % (error_map / truth_norm))

    return error_ml, error_scaled, error_map, error_map_conv
コード例 #3
0
def perform_estimation(residuals, tracker):
    residuals = residuals - np.average(residuals, axis=0)
    cor = Correlator(residuals)
    C_arr = cor.autocorrelation(used_taps)
    R_ml = estimate_noise_ukf_ml(C_arr[0], tracker.Pz)
    # R_scaled = estimate_noise_ukf_scaling(C_arr[0], tracker.Pz, tracker.R)
    return R_ml
コード例 #4
0
def perform_estimation(residuals, tracker):
    cor = Correlator(residuals)
    correlation = cor.autocorrelation(used_taps)
    R = estimate_noise_ukf_ml(correlation[0], tracker.Pz)
    truth = R_proto * measurement_var
    error = matrix_error(R, truth)
    print("Truth:\n", truth)
    print("Estimation:\n", R)
    print("Error: %.6f" % error)
    print("-" * 15)
    return error
コード例 #5
0
 def test_ukf_estimate_ml(self):
     C = np.asarray([[0.04271917, -0.00366983], [-0.00366983, 0.01893147]])
     P_zz = np.asarray([[1.01043425e-02, 3.41826761e-05],
                        [3.41826761e-05, 1.00712847e-02]])
     R = estimate_noise_ukf_ml(C, P_zz)
     assert R.shape == (2, 2)