コード例 #1
0
if args.mode == "test1":
  inputs = all_inputs[:,:,args.case]
  simdata = DiscreteTimeSystemSimulation(sys, est, x_init, P_init, 2*len(beacon_x), inputs, nruns)
  simdata.analysis()

  # Chi2 Overlay Plots
  chi2_overlay(simdata.NEES_est[0,:], simdata.state_dim,
    r"Overlay with EKF $\rho_k$", plot_nbins=args.plot_nbins, plt_chi2_pdf=False)
  chi2_overlay(simdata.NEES_true[0,:], simdata.state_dim,
    r"Overlay with EKF Monte-Carlo $\rho_k$", plot_nbins=args.plot_nbins)

  # MC Confidence Bounds plot
  alpha = 0.95
  NEES_est_sum = np.sum(simdata.NEES_est, axis=0)
  NEES_true_sum = np.sum(simdata.NEES_true, axis=0)
  interval_bounds_plot(NEES_est_sum, simdata.state_dim, alpha,
    "{} interval for EKF Estimated NEES".format(alpha), simdata.nruns)
  interval_bounds_plot(NEES_true_sum, simdata.state_dim, alpha,
    "{} interval for EKF True NEES".format(alpha), simdata.nruns)

  # Timeseries plot
  simdata.plt_timeseries(stepsize=2)

  # White noise plot
  simdata.plt_inn(1/dt)

  plt.show()


# Save one run from all of them
elif args.mode == "saveall":
  num_test_cases = 1
コード例 #2
0
print("Scale: {}".format(scale.value))

# Apply scalar mapping to all estimated covariances
s = scale.value
for simdata in simdata_test:
    simdata.Pest = s * simdata.Pest

# Evaluate covariance on test data
simdata = simdata_test[0]

# Calculate NEES and divergence
simdata.calc_tot_NEES()
simdata.calc_divergence(nbins=nbins)

simdata.compute_sigma_percentages()

# Chi2 Overlay Plot
chi2_overlay(simdata.NEES_est[0, :],
             simdata.state_dim,
             "",
             plot_nbins=40,
             plt_chi2_pdf=True)

# Confidence bounds plot
NEES_est_sum = np.sum(simdata.NEES_est, axis=0)
alpha = 0.95
interval_bounds_plot(NEES_est_sum, simdata.state_dim, alpha,
                     "{} interval for EKF Scalar-Adjusted NEES".format(alpha),
                     simdata.nruns)

plt.show()