推断统计概念

Python 线性建模入门

Jason Vestuto

Data Scientist

概率分布

日数与温度区间的直方图,8 月的每日最高气温

Python 线性建模入门

总体与统计量

日数与温度区间的直方图,8 月的每日最高气温

Python 线性建模入门

抽样总体

总体统计量 vs 样本统计量

print( len(month_of_temps), month_of_temps.mean(), month_of_temps.std() )
print( len(decade_of_temps), decade_of_temps.mean(), decade_of_temps.std() )

从总体中随机抽样

month_of_temps = np.random.choice(decade_of_temps, size=31)
Python 线性建模入门

分布可视化

两幅直方图,一幅为样本一幅为总体,均为日数对温度区间,样本的柱明显更低

Python 线性建模入门

分布可视化

两幅直方图,一幅为样本一幅为总体,均为标准化日数对温度区间,样本柱高与总体大致相当

Python 线性建模入门

概率与推断

日数与温度区间的直方图,8 月的每日最高气温

Python 线性建模入门

分布可视化

两个不同样本的两幅直方图,均为标准化日数对温度区间,柱高相近但各区间略有差异

Python 线性建模入门

重抽样

# Resampling as Iteration
num_samples = 20
for ns in range(num_samples):
    sample = np.random.choice(population, num_pts)
    distribution_of_means[ns] = sample.mean()
# Sample Distribution Statistics
mean_of_means = np.mean(distribution_of_means)
stdev_of_means = np.std(distribution_of_means)
Python 线性建模入门

Passons à la pratique !

Python 线性建模入门

Preparing Video For Download...