Skip to content

Instantly share code, notes, and snippets.

@maxdevblock
Created November 14, 2022 13:46
Show Gist options
  • Save maxdevblock/cc4623dd8ef82fd9b36235778451f5a4 to your computer and use it in GitHub Desktop.
Save maxdevblock/cc4623dd8ef82fd9b36235778451f5a4 to your computer and use it in GitHub Desktop.
# Zn variable from Yn
Zn2 = (Yn - d.mean()) / (d.std()/np.sqrt(n))
# Standard Normal distribution of Zn
plt.hist(Zn2, density=True)
Znd = sps.norm(loc=0, scale=1)
Znx = np.linspace(Znd.ppf(.0001), Znd.ppf(.9999), 100)
Zny = Znd.pdf(Znx)
plt.plot(Znx, Zny, lw=5)
plt.title("Distribution of r.v. $Z_n$ from $Y_n$")
plt.xlabel("$z$")
plt.ylabel("$f(z)$")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment