val, _ = quad(f, 0.0, z, limit=100)
return val / r_d
def DH_rd(z, Om, eps, H0=67.4):
return C_KMS / (H0 * E_tep(z, Om, eps) * r_d)
def chi2_func(Om, eps):
total = 0.0
for i in range(len(z_eff)):
th = DM_rd(z_eff[i],Om,eps) if kind[i]=='DM' else DH_rd(z_eff[i],Om,eps)
total += ((obs[i] - th) / sigma[i])**2
return total
# Optimise LCDM (epsilon = 0 fixed)
res_L = minimize(lambda x: chi2_func(x[0], 0.0),
x0=[0.30], bounds=[(0.10,0.60)], method='L-BFGS-B')
Om_L, chi2_L = res_L.x[0], res_L.fun
# Optimise TEP (epsilon free)
res_T = minimize(lambda x: chi2_func(x[0], x[1]),
x0=[0.30, 0.0],
bounds=[(0.10,0.60),(-1.0,1.0)],
method='L-BFGS-B')
Om_T, eps_T, chi2_T = res_T.x[0], res_T.x[1], res_T.fun
N = len(z_eff) # 7 data points
AIC_L = chi2_L + 2*1; AIC_T = chi2_T + 2*2
BIC_L = chi2_L + 1*np.log(N); BIC_T = chi2_T + 2*np.log(N)
print(f'LCDM : Om={Om_L:.4f}, chi2={chi2_L:.4f}')
print(f'TEP : Om={Om_T:.4f}, eps={eps_T:.4f}, chi2={chi2_T:.4f}')
print(f'Delta_chi2={chi2_T-chi2_L:.4f}, Delta_AIC={AIC_T-AIC_L:.4f},
Delta_BIC={BIC_T-BIC_L:.4f}')
4.4 Numerical Results
Running the code against the DESI 2024 BAO data yields the following results:
Table 2. Chi-squared likelihood results for ΛCDM and TEP against DESI
2024 BAO.