# likelihood_measure.calc_likelihood(hurst_related_exponent_local, # characteristic_dist_local, # fft_well_log, # list_wave_number, # squared_energy_of_window, # variance_gaussian_noise_time_domain) # return output if __name__ == '__main__': # ############################################### # Choose test to run test_to_run = 'likelihood' # ############################################### for case in math_op.switch(test_to_run): if case('likelihood'): # ################################################################## # USER CONFIG: choose run parameters # ################################################################## do_parallel = 0 num_value_well_log = 2 ** 12 no_noise = 0 # if true, no noise in observed well log e.g well log is exactly von karman spectrum hurst_related_exponent_true = 0.5 # (-0.25, -0.25, 0.25, 0.5, 0.75) characteristic_dist_true = 5.0 # [m] # (10.0, 5.00, 10.00, 5.00, 3) mean_gaussian_noise_time_domain = 0.0 variance_gaussian_noise_time_domain_true = 1.0e-10 hurst_hurst_related_exponent_guess_start = max(hurst_related_exponent_true - 0.45, -0.49)
print 'l2_regression_powers_error = %g' % l2_regression_powers_error print 'l2_median_balance_powers_error / l2_regression_powers_error = %g' % (l2_median_balance_powers_error/l2_regression_powers_error) return output if __name__ == '__main__': ##########choose test########################## test_to_run = 'median_balance' #################################################3 for case in math_op.switch(test_to_run): if case('compare_medianbal_vs_regression'): list_of_power = np.array([2]*10) output = compareMedianBalanceVsRegressionGivenGroundTruth( list_of_power, num_time_sample = 2000, origin_time_sample = 1, delta_time_sample = 0.002, width_parameter_ricker_wavelet = 10, noise_level = 0) powers_col_by_col = np.transpose(np.vstack((output.list_median_balance_recovered_power,output.list_regression_recovered_power))) plt.figure() plt.hist(powers_col_by_col, histtype='bar', label=['median balance', 'regression']) plt.legend()