标准误差

Python 线性建模入门

Jason Vestuto

Data Scientist

预测的不确定性

模型预测与RMSE:

  • 预测与数据比较得残差
  • 残差有离散度
  • RMSE:衡量残差离散
  • RMSE:量化预测好坏
Python 线性建模入门

参数的不确定性

模型参数与标准误差:

  • 参数值为中心
  • 参数标准误差为离散度
  • 标准误差:衡量参数不确定性
Python 线性建模入门

计算标准误差

df = pd.DataFrame(dict(times=x_data, distances=y_data))
model_fit = ols(formula="distances ~ times", data=df).fit()
a1 = model_fit.params['times']
a0 = model_fit.params['Intercept']
slope = a1
intercept = a0
Python 线性建模入门

计算标准误差

e0 = model_fit.bse['Intercept']
e1 = model_fit.bse['times']
standard_error_of_intercept = e0
standard_error_of_slope = e1
Python 线性建模入门

让我们来练习!

Python 线性建模入门

Preparing Video For Download...