Skip to content

Instantly share code, notes, and snippets.

@maxdevblock
Created November 14, 2022 13:42
Show Gist options
  • Save maxdevblock/74d51558d0004aec3d4eb00ec95e0d25 to your computer and use it in GitHub Desktop.
Save maxdevblock/74d51558d0004aec3d4eb00ec95e0d25 to your computer and use it in GitHub Desktop.
# Zn variable from Sn
Zn1 = (Sn - n*d.mean()) / (np.sqrt(n)*d.std())
# Standard Normal distribution of Zn
plt.hist(Zn1, 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 $S_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