总体参数的估计
想象有一个由卫星组成的星座("population"),在一整年中持续运行,并以公里为单位记录每小时行驶的距离。由于轨道动力学中一些未知的复杂因素,每小时的距离会有所波动。假设我们无法获取全年所有数据,但希望基于一部分测量样本,为每小时的轨道距离变化(速度)建立一个总体模型。
在本练习中,您将假设每小时距离的总体最适合用高斯分布来建模,并进一步假设该总体模型的参数可以由样本统计量估计。请从预加载的 sample_distances 开始,它取自一个卫星总体。


本练习是课程的一部分
Python 线性建模入门
练习说明
- 计算
sample_distances的均值和标准差。 - 使用样本统计量
mean和stdev作为总体模型参数mu和sigma的良好估计。 - 将这些值以及
sample_distances传给预定义的gaussian_model(),以构建总体模型。 - 使用预定义的
plot_model_and_data(),将样本数据与总体模型一同绘制出来。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Compute the mean and standard deviation of the sample_distances
sample_mean = np.mean(____)
sample_stdev = np.std(____)
# Use the sample mean and stdev as estimates of the population model parameters mu and sigma
population_model = gaussian_model(____, mu=____, sigma=____)
# Plot the model and data to see how they compare
fig = plot_data_and_model(sample_distances, population_model)