print("Data shape:", x.shape) print("Theta shape:", data_param.theta.shape) print("Theta:", data_param.theta) # parvalue number of sub intervals # Note : numsubinterval = 1 => only observed data points, no intermediate brownian bridges em_param = prm.em(tol=0.01 * prm.dim * prm.dof, burninpaths=10, mcmcpaths=100, numsubintervals=5, niter=100, dt=(allt[0, 1] - allt[0, 0])) # call to EM which returns the final error and estimated theta value error_list, theta_list, gammavec_list = em(x, t, em_param, data_param) estimated_theta = prm.theta_transformations(theta=theta_list[-1], theta_type='hermite') true_theta = prm.theta_transformations(theta=dc.true_theta(sim_param), theta_type='ordinary') print("\n Estimated ordinary: ", np.transpose(estimated_theta.ordinary), "\n True ordinary: ", np.transpose(true_theta.ordinary)) print("\n Estimated hermite: ", np.transpose(estimated_theta.hermite), "\n True hermite: ", np.transpose(true_theta.hermite)) threshold = np.array([0., 0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5]) ordinary_errors = [] hermite_errors = []
print("Data shape:", x.shape) print("Theta shape:", data_param.theta.shape) print("Theta:", data_param.theta) # parvalue number of sub intervals # Note : numsubinterval = 1 => only observed data points, no intermediate brownian bridges em_param = prm.em(tol=0.1, burninpaths=10, mcmcpaths=100, numsubintervals=5, niter=100, dt=(allt[0, 1] - allt[0, 0])) # call to EM which returns the final error and estimated theta value start_time = time.time() error_list, theta_list, gammavec_list, avg_ar_burnin, avg_ar_sampling = em( x, t, em_param, data_param) time_taken = time.time() - start_time print("Time taken for 4D EM: ", time_taken) print("Average AR burnin: ", avg_ar_burnin, ", average AR sampling: ", avg_ar_sampling) estimated_theta = prm.theta_transformations(theta=theta_list[-1], theta_type='hermite') true_theta = prm.theta_transformations(theta=dc.true_theta(sim_param), theta_type='ordinary') print("\n Estimated ordinary: ", np.transpose(estimated_theta.ordinary), "\n True ordinary: ", np.transpose(true_theta.ordinary)) print("\n Estimated hermite: ", np.transpose(estimated_theta.hermite), "\n True hermite: ", np.transpose(true_theta.hermite))