@@ -228,7 +228,7 @@ def generate_histogram(X_distribution, n, m):
228228 ax.axvline(x=mu, ls="--", lw=3, label=fr"$\mu = {mu}$")
229229
230230 ax.set_xlim(min(sample_means), max(sample_means))
231- ax.set_xlabel(r'$\bar x_n $', size=12)
231+ ax.set_xlabel(r'$\bar X_n $', size=12)
232232 ax.set_ylabel('density', size=12)
233233 ax.legend()
234234 plt.show()
@@ -263,14 +263,16 @@ def generate_multiple_hist(X_distribution, ns, m, log_scale=False):
263263 ax.axvline(x=mu, ls="--", lw=3, label=fr"$\mu = {mu}$")
264264
265265 ax.set_xlim(min(sample_means), max(sample_means))
266- ax.set_xlabel(r'$\bar x_n $', size=12)
266+ ax.set_xlabel(r'$\bar X_n $', size=12)
267267 ax.set_ylabel('density', size=12)
268268 ax.legend()
269269 plt.show()
270270```
271271
272272``` {code-cell} ipython3
273- generate_multiple_hist(st.norm(loc=5, scale=2), ns=[20_000, 50_000, 100_000], m=10_000)
273+ generate_multiple_hist(st.norm(loc=5, scale=2),
274+ ns=[20_000, 50_000, 100_000],
275+ m=10_000)
274276```
275277
276278The histogram gradually converges to $\mu$ as the sample size n increases.
@@ -305,7 +307,7 @@ def scattered_mean(distribution, burn_in, n, jump, ax, title, color, ylog=False)
305307 ax.set_yscale("symlog")
306308 ax.set_title(title, size=10)
307309 ax.set_xlabel(r"$n$", size=12)
308- ax.set_ylabel(r"$\bar x_n $", size=12)
310+ ax.set_ylabel(r"$\bar X_n $", size=12)
309311 yabs_max = max(ax.get_ylim())
310312 ax.set_ylim(ymin=-yabs_max, ymax=yabs_max)
311313 return ax
@@ -553,10 +555,13 @@ We mentioned above that LLN can still hold sometimes when IID is violated.
553555Let's investigate this claim further.
554556
555557Assume we have a AR(1) process as below:
558+
556559$$
557560X_{t+1} = \alpha + \beta X_t + \sigma \epsilon _{t+1}
558561$$
559562
563+ and
564+
560565$$
561566X_0 \sim \mathcal{N} \left(\frac{\alpha}{1-\beta}, \frac{\sigma^2}{1-\beta^2}\right)
562567$$
@@ -634,7 +639,7 @@ for t in range(n-1):
634639ax.scatter(range(100, n), means[100:n], s=10, alpha=0.5)
635640
636641ax.set_xlabel(r"$n$", size=12)
637- ax.set_ylabel(r"$\bar x_n $", size=12)
642+ ax.set_ylabel(r"$\bar X_n $", size=12)
638643yabs_max = max(ax.get_ylim(), key=abs)
639644ax.axhline(y=α/(1-β), ls="--", lw=3,
640645 label=r"$\mu = \frac{\alpha}{1-\beta}$",
0 commit comments