要验证两个变量 $\alpha_\mathrm{obs,X} = 1.286 \pm 0.030$ 和 $\alpha_\mathrm{obs,O} = 1.340 \pm 0.002$ 是否一致,我们需要检查它们的测量值在考虑到不确定度的情况下是否兼容。通常在物理学中,如果两个测量的差值相对于它们的联合不确定度足够小(例如小于某个显著性水平),我们就认为它们是一致的。
第一步:计算差值
首先,计算两个测量值的差值:
$\Delta = \alpha_\mathrm{obs,O} - \alpha_\mathrm{obs,X} = 1.340 - 1.286 = 0.054$
第二步:计算联合不确定度
由于这两个测量是独立的,不确定度的平方和开根号给出了差值的联合不确定度:
$\sigma_{\Delta} = \sqrt{\sigma_X^2 + \sigma_O^2} = \sqrt{(0.030)^2 + (0.002)^2} = \sqrt{0.0009 + 0.000004} \approx \sqrt{0.000904} \approx 0.0301$
第三步:评估显著性
为了判断差值是否显著,我们计算差值与联合不确定度的比值(类似于 z 分数):
$z = \frac{\Delta}{\sigma_{\Delta}} = \frac{0.054}{0.0301} \approx 1.79$
这个值表示差值大约是 1.79 个标准差(sigma)。
第四步:统计检验
在统计学中,我们常用显著性水平(例如 5%)来判断一致性。对于正态分布,1.79 sigma 对应于双尾检验的 p 值约为 0.073(即 7.3%),因为 1.96 sigma 对应 5%。由于 0.073 > 0.05,差值在 5% 显著性水平下不显著,表明我们不能拒绝这两个测量值一致的假设。
此外,在物理学中,两个测量值如果差值小于 2 sigma,通常认为是一致的。这里 1.79 < 2,进一步支持它们一致。
第五步:交叉验证(可选)
另一种方法是计算加权平均并用 $\chi^2$ 检验:
- 加权平均 $\alpha_\mathrm{best}$ 使用不确定度的倒数平方作为权重:
$w_X = \frac{1}{(0.030)^2} \approx 1111.11, \quad w_O = \frac{1}{(0.002)^2} = 250000$
$\alpha_\mathrm{best} = \frac{1.286 \times 1111.11 + 1.340 \times 250000}{1111.11 + 250000} \approx 1.3397$ - $\chi^2 = \left(\frac{1.286 - 1.3397}{0.030}\right)^2 + \left(\frac{1.340 - 1.3397}{0.002}\right)^2 \approx 3.2266$
- 对于 1 个自由度,$\chi^2 = 3.84$ 对应 5% 水平,3.2266 < 3.84,p 值 > 0.05,与 z 检验结果一致。
结论
基于 z 检验(差值约为 1.79 sigma,p ≈ 0.073 > 0.05)和 $\chi^2$ 检验,两个测量值在 5% 显著性水平下是一致的。因此,答案是:
是一致的
import numpy as np
from scipy.stats import chi2, norm
# P-value to sigma
def p_value_to_sigma(p_value):
"""Convert p-value to sigma level."""
return norm.ppf(1 - p_value / 2)
# Given decay indices and their uncertainties
alpha_x = 1.286
sigma_x = 0.030
alpha_o = 1.340
sigma_o = 0.002
alphas = np.array([alpha_x, alpha_o])
# Calculate weights (w_i = 1 / sigma_i^2)
weights = np.array([1 / sigma_x**2, 1 / sigma_o**2])
# Compute weighted average
weighted_avg = weights @ alphas / np.sum(weights)
weighted_sigma = np.sqrt(1 / np.sum(weights))
# chi-squared statistic
chi2_val = np.sum(((alphas - weighted_avg) ** 2) * weights)
# Degrees of freedom (n - 1, where n is the number of measurements)
dof = len(alphas) - 1
# p-value
p_value = 1 - chi2.cdf(chi2_val, dof)
# Evaluate consistency at 5% significance level
critical_value = chi2.ppf(0.95, dof)
if chi2_val < critical_value:
print("The measurements are consistent with the weighted average.")
else:
print("The measurements are not consistent with the weighted average.")
{
"weighted_average": weighted_avg,
"weighted_sigma": weighted_sigma,
"chi2_value": chi2_val,
"degrees_of_freedom": dof,
"p_value": p_value,
"sigma_level": p_value_to_sigma(p_value)
}
The measurements are consistent with the weighted average.
{'weighted_average': 1.3397610619469027,
'weighted_sigma': 0.001995570315713218,
'chi2_value': 3.225663716814165,
'degrees_of_freedom': 1,
'p_value': 0.07249240434519022,
'sigma_level': 1.796013284141897}