diff --git a/docs/source/nb/asymmetric_errors.ipynb b/docs/source/nb/asymmetric_errors.ipynb index 1fde2c8..76244ee 100644 --- a/docs/source/nb/asymmetric_errors.ipynb +++ b/docs/source/nb/asymmetric_errors.ipynb @@ -96,7 +96,7 @@ "source": [ "fig, ax = plt.subplots(1, 1, figsize=(5,5))\n", "L = np.exp(lnL)\n", - "L/=np.trapz(L, a)\n", + "L/=np.trapezoid(L, a)\n", "# print(L)\n", "ax.plot(a, L)\n", "fig.tight_layout()" @@ -118,7 +118,7 @@ "fig, ax = plt.subplots(1, 1, figsize=(5,5))\n", "cdf = np.zeros_like(a)\n", "for i in range(a.size):\n", - " cdf[i] = np.trapz(L[:i], a[:i])\n", + " cdf[i] = np.trapezoid(L[:i], a[:i])\n", "ax.plot(a, cdf)\n", "fig.tight_layout()" ] @@ -198,7 +198,7 @@ " if self.ci_hi == self.ci_lo:\n", " pass\n", " else:\n", - " L = self.likelihood(a)/np.trapz(self.likelihood(a), a)\n", + " L = self.likelihood(a)/np.trapezoid(self.likelihood(a), a)\n", " return L\n", " \n", " def get_cdf(self, a):\n", @@ -207,7 +207,7 @@ " else:\n", " cdf = np.zeros_like(a)\n", " for i in range(a.size):\n", - " cdf[i] = np.trapz(self.get_pdf(a)[:i], a[:i])\n", + " cdf[i] = np.trapezoid(self.get_pdf(a)[:i], a[:i])\n", " return cdf\n", " \n", " \n", @@ -233,7 +233,7 @@ " L = self.get_pdf(a)\n", " cdf = np.zeros_like(a)\n", " for i in range(n):\n", - " cdf[i] = np.trapz(L[:i], a[:i])\n", + " cdf[i] = np.trapezoid(L[:i], a[:i])\n", " cut = self.get_cdf(a) > 0 \n", " Cdf = PchipInterpolator(self.get_cdf(a)[cut], a[cut])\n", " u = np.random.uniform(0.,1., 50000)\n", @@ -268,7 +268,7 @@ "# y = a.get_random(2000)\n", "# # print(y)\n", "# # ln = a.get_cdf(x)\n", - "# # # ln/=np.trapz(ln, x)\n", + "# # # ln/=np.trapezoid(ln, x)\n", "# # # print(ln)\n", "# fig, ax = plt.subplots(1, 1, figsize=(5,5))\n", "# ax.hist(y, bins=x, alpha=0.7, density=True)\n",