Skip to content

Commit

Permalink
made symbol changes and added test case for function
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanhemani committed Jun 21, 2020
1 parent 051f9a3 commit b939603
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 47 deletions.
8 changes: 4 additions & 4 deletions datascience/util.py
Expand Up @@ -88,10 +88,10 @@ def plot_normal_cdf(rbound=None, lbound=None, mean=0, sd=1):
llabel = lbound
if rbound is None:
rbound = inf + mean
rlabel = "$\infty$"
rlabel = r"$\infty$"
if lbound is None:
lbound = -inf + mean
llabel = "-$\infty$"
llabel = r"-$\infty$"
pdf_range = np.arange(-inf + mean, inf + mean, step)
plt.plot(pdf_range, stats.norm.pdf(pdf_range, loc=mean, scale=sd), color='k', lw=1)
cdf_range = np.arange(lbound, rbound + step, step)
Expand All @@ -102,8 +102,8 @@ def plot_normal_cdf(rbound=None, lbound=None, mean=0, sd=1):
plt.fill_between(cdf_range, stats.norm.pdf(cdf_range, loc=mean, scale=sd), color='darkblue')
plt.ylim(0, stats.norm.pdf(0, loc=0, scale=sd) * 1.25)
plt.xlabel('z')
plt.ylabel('$\phi$(z)', rotation=90)
plt.title("Normal Curve ~ ($\mu$ = {0}, $\sigma$ = {1}) "
plt.ylabel(r'$\phi$(z)', rotation=90)
plt.title(r"Normal Curve ~ ($\mu$ = {0}, $\sigma$ = {1}) "
"{2} < z < {3}".format(mean, sd, llabel, rlabel), fontsize=16)
plt.show()

Expand Down

0 comments on commit b939603

Please sign in to comment.