Newer
Older
Master_thesis / archive / .ipynb_checkpoints / discovery_zfit_freq-checkpoint.ipynb
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "import numpy as np\n",
  10. "import matplotlib.pyplot as plt\n",
  11. "from lauztat.parameters import POI\n",
  12. "from lauztat.hypotests import Discovery\n",
  13. "from lauztat.calculators import FrequentistCalculator\n",
  14. "from lauztat.config import Config"
  15. ]
  16. },
  17. {
  18. "cell_type": "code",
  19. "execution_count": 2,
  20. "metadata": {},
  21. "outputs": [
  22. {
  23. "name": "stdout",
  24. "output_type": "stream",
  25. "text": [
  26. "\n",
  27. "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n",
  28. "For more information, please see:\n",
  29. " * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n",
  30. " * https://github.com/tensorflow/addons\n",
  31. "If you depend on functionality not listed there, please file an issue.\n",
  32. "\n"
  33. ]
  34. }
  35. ],
  36. "source": [
  37. "import tensorflow as tf\n",
  38. "import zfit\n",
  39. "from zfit import ztf"
  40. ]
  41. },
  42. {
  43. "cell_type": "markdown",
  44. "metadata": {},
  45. "source": [
  46. "## Signal + background fit:"
  47. ]
  48. },
  49. {
  50. "cell_type": "code",
  51. "execution_count": 3,
  52. "metadata": {},
  53. "outputs": [
  54. {
  55. "data": {
  56. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAO0ElEQVR4nO3dcYxlZ1nH8e/Ptkgr4KK7CG47DhjSBAmEOkGwCZJWTG1Ja2L/aBOwRcgkGqAYDS4SJfGvTTQoigkZpYLaFJKCWikolUIaCWzc1hZa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AMOjg3bU6+RcbMK8IPAV9bcP87ZC39mTFWdAr4B/OCM6tkJuqwJwM+PfhS8LclF6zy+l3Rds73kpUnuT/KRJD+23cXMy+gU64uAI2MP7enXyKwCvMtl9p0uxd9Funy+fwMsVtULgL/n/39C2av22mtkkntZ7YnxQuAPgb/a5nrmIslTgA8Ab6qqb44/vM5T9sxrZFYB3uUy+zNjkpwLfD+7+8fHiWtSVV+vqv8e3f1j4MfnVNtOZbuGNarqm1X1n6PbHwbOS7J/m8uaqSTnsRret1TVB9cZsqdfI7MK8C6X2d8O3DC6fS1wV41+K7FLTVyTsXN3V7N6zm8vux34hdE7DV4CfKOqHtnuorZLkmee/j1Rkhez+v379e2tanZGn+u7gWNV9fYNhu3p10ifboQbqg0us0/y28DRqrqd1S/Mnyd5iNUj7+tmUctO0XFN3pjkauAUq2ty47YVPAdJbmX1nRX7kxwH3gacB1BV7wI+zOq7DB4Cvg28ZnsqnY8O63Et8EtJTgEnget2+UHPpcCrgc8muW+07TeABdibr5FxXkovSY3ySkxJapQBLkmNMsAlqVEGuCQ1ygCXpEYZ4JLUKANckhr1fyzUmmQlfg4vAAAAAElFTkSuQmCC\n",
  57. "text/plain": [
  58. "<Figure size 432x288 with 1 Axes>"
  59. ]
  60. },
  61. "metadata": {
  62. "needs_background": "light"
  63. },
  64. "output_type": "display_data"
  65. }
  66. ],
  67. "source": [
  68. "bounds = (0.1, 3.0)\n",
  69. "\n",
  70. "# Data and signal\n",
  71. "\n",
  72. "np.random.seed(0)\n",
  73. "tau = -2.0\n",
  74. "beta = -1/tau\n",
  75. "data = np.random.exponential(beta, 300)\n",
  76. "peak = np.random.normal(1.2, 0.1, 25)\n",
  77. "data = np.concatenate((data,peak))\n",
  78. "data = data[(data > bounds[0]) & (data < bounds[1])]\n",
  79. "\n",
  80. "plt.hist(data, bins=100, histtype='step');"
  81. ]
  82. },
  83. {
  84. "cell_type": "code",
  85. "execution_count": 4,
  86. "metadata": {},
  87. "outputs": [],
  88. "source": [
  89. "obs = zfit.Space('x', limits=bounds)"
  90. ]
  91. },
  92. {
  93. "cell_type": "code",
  94. "execution_count": 5,
  95. "metadata": {},
  96. "outputs": [
  97. {
  98. "name": "stdout",
  99. "output_type": "stream",
  100. "text": [
  101. "WARNING:tensorflow:From C:\\Users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\ops\\resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n",
  102. "Instructions for updating:\n",
  103. "Colocations handled automatically by placer.\n"
  104. ]
  105. }
  106. ],
  107. "source": [
  108. "mean = zfit.Parameter(\"mean\", 1.2, 0.1, 2., floating=False)\n",
  109. "sigma = zfit.Parameter(\"sigma\", 0.1, floating=False)\n",
  110. "lambda_ = zfit.Parameter(\"lambda\",-2.0, -4.0, -1.0)\n",
  111. "Nsig = zfit.Parameter(\"Nsig\", 20., -20., len(data))\n",
  112. "Nbkg = zfit.Parameter(\"Nbkg\", len(data), 0., len(data)*1.1)"
  113. ]
  114. },
  115. {
  116. "cell_type": "code",
  117. "execution_count": 6,
  118. "metadata": {},
  119. "outputs": [],
  120. "source": [
  121. "signal = Nsig * zfit.pdf.Gauss(obs=obs, mu=mean, sigma=sigma)\n",
  122. "background = Nbkg * zfit.pdf.Exponential(obs=obs, lambda_=lambda_)\n",
  123. "tot_model = signal + background"
  124. ]
  125. },
  126. {
  127. "cell_type": "code",
  128. "execution_count": 7,
  129. "metadata": {},
  130. "outputs": [],
  131. "source": [
  132. "# Create the negative log likelihood\n",
  133. "from zfit.core.loss import ExtendedUnbinnedNLL, UnbinnedNLL\n",
  134. "data_ = zfit.data.Data.from_numpy(obs=obs, array=data)\n",
  135. "nll = ExtendedUnbinnedNLL(model=[tot_model], data=[data_], fit_range=[obs]) "
  136. ]
  137. },
  138. {
  139. "cell_type": "code",
  140. "execution_count": 8,
  141. "metadata": {},
  142. "outputs": [],
  143. "source": [
  144. "# Load and instantiate a tensorflow minimizer\n",
  145. "from zfit.minimizers.minimizer_minuit import MinuitMinimizer\n",
  146. "minimizer = MinuitMinimizer()"
  147. ]
  148. },
  149. {
  150. "cell_type": "code",
  151. "execution_count": 9,
  152. "metadata": {},
  153. "outputs": [
  154. {
  155. "data": {
  156. "text/html": [
  157. "<hr>"
  158. ]
  159. },
  160. "metadata": {},
  161. "output_type": "display_data"
  162. },
  163. {
  164. "data": {
  165. "text/html": [
  166. "<table>\n",
  167. " <tr>\n",
  168. " <td title=\"Minimum value of function\">FCN = -1145.2067313908976</td>\n",
  169. " <td title=\"Total number of call to FCN so far\">TOTAL NCALL = 70</td>\n",
  170. " <td title=\"Number of call in last migrad\">NCALLS = 70</td>\n",
  171. " </tr>\n",
  172. " <tr>\n",
  173. " <td title=\"Estimated distance to minimum\">EDM = 2.0741373583835403e-06</td>\n",
  174. " <td title=\"Maximum EDM definition of convergence\">GOAL EDM = 5e-06</td>\n",
  175. " <td title=\"Error def. Amount of increase in FCN to be defined as 1 standard deviation\">\n",
  176. " UP = 0.5</td>\n",
  177. " </tr>\n",
  178. "</table>\n",
  179. "<table>\n",
  180. " <tr>\n",
  181. " <td align=\"center\" title=\"Validity of the migrad call\">Valid</td>\n",
  182. " <td align=\"center\" title=\"Validity of parameters\">Valid Param</td>\n",
  183. " <td align=\"center\" title=\"Is Covariance matrix accurate?\">Accurate Covar</td>\n",
  184. " <td align=\"center\" title=\"Positive definiteness of covariance matrix\">PosDef</td>\n",
  185. " <td align=\"center\" title=\"Was covariance matrix made posdef by adding diagonal element\">Made PosDef</td>\n",
  186. " </tr>\n",
  187. " <tr>\n",
  188. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  189. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  190. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  191. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  192. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  193. " </tr>\n",
  194. " <tr>\n",
  195. " <td align=\"center\" title=\"Was last hesse call fail?\">Hesse Fail</td>\n",
  196. " <td align=\"center\" title=\"Validity of covariance\">HasCov</td>\n",
  197. " <td align=\"center\" title=\"Is EDM above goal EDM?\">Above EDM</td>\n",
  198. " <td align=\"center\"></td>\n",
  199. " <td align=\"center\" title=\"Did last migrad call reach max call limit?\">Reach calllim</td>\n",
  200. " </tr>\n",
  201. " <tr>\n",
  202. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  203. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  204. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  205. " <td align=\"center\"></td>\n",
  206. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  207. " </tr>\n",
  208. "</table>"
  209. ]
  210. },
  211. "metadata": {},
  212. "output_type": "display_data"
  213. },
  214. {
  215. "data": {
  216. "text/html": [
  217. "<table>\n",
  218. " <tr>\n",
  219. " <td><a href=\"#\" onclick=\"$('#UxIJHoHYmM').toggle()\">+</a></td>\n",
  220. " <td title=\"Variable name\">Name</td>\n",
  221. " <td title=\"Value of parameter\">Value</td>\n",
  222. " <td title=\"Hesse error\">Hesse Error</td>\n",
  223. " <td title=\"Minos lower error\">Minos Error-</td>\n",
  224. " <td title=\"Minos upper error\">Minos Error+</td>\n",
  225. " <td title=\"Lower limit of the parameter\">Limit-</td>\n",
  226. " <td title=\"Upper limit of the parameter\">Limit+</td>\n",
  227. " <td title=\"Is the parameter fixed in the fit\">Fixed?</td>\n",
  228. " </tr>\n",
  229. " <tr>\n",
  230. " <td>0</td>\n",
  231. " <td>lambda</td>\n",
  232. " <td>-1.93315</td>\n",
  233. " <td>0.140803</td>\n",
  234. " <td></td>\n",
  235. " <td></td>\n",
  236. " <td>-4</td>\n",
  237. " <td>-1</td>\n",
  238. " <td>No</td>\n",
  239. " </tr>\n",
  240. " <tr>\n",
  241. " <td>1</td>\n",
  242. " <td>Nsig</td>\n",
  243. " <td>19.4765</td>\n",
  244. " <td>7.12684</td>\n",
  245. " <td></td>\n",
  246. " <td></td>\n",
  247. " <td>-20</td>\n",
  248. " <td>271</td>\n",
  249. " <td>No</td>\n",
  250. " </tr>\n",
  251. " <tr>\n",
  252. " <td>2</td>\n",
  253. " <td>Nbkg</td>\n",
  254. " <td>251.519</td>\n",
  255. " <td>16.7673</td>\n",
  256. " <td></td>\n",
  257. " <td></td>\n",
  258. " <td>0</td>\n",
  259. " <td>298.1</td>\n",
  260. " <td>No</td>\n",
  261. " </tr>\n",
  262. "</table>\n",
  263. "<pre id=\"UxIJHoHYmM\" style=\"display:none;\">\n",
  264. "<textarea rows=\"12\" cols=\"50\" onclick=\"this.select()\" readonly>\n",
  265. "\\begin{tabular}{|c|r|r|r|r|r|r|r|c|}\n",
  266. "\\hline\n",
  267. " & Name & Value & Hesse Error & Minos Error- & Minos Error+ & Limit- & Limit+ & Fixed?\\\\\n",
  268. "\\hline\n",
  269. "0 & $\\lambda$ & -1.93315 & 0.140803 & & & -4.0 & -1 & No\\\\\n",
  270. "\\hline\n",
  271. "1 & Nsig & 19.4765 & 7.12684 & & & -20.0 & 271 & No\\\\\n",
  272. "\\hline\n",
  273. "2 & Nbkg & 251.519 & 16.7673 & & & 0.0 & 298.1 & No\\\\\n",
  274. "\\hline\n",
  275. "\\end{tabular}\n",
  276. "</textarea>\n",
  277. "</pre>"
  278. ]
  279. },
  280. "metadata": {},
  281. "output_type": "display_data"
  282. },
  283. {
  284. "data": {
  285. "text/html": [
  286. "<hr>"
  287. ]
  288. },
  289. "metadata": {},
  290. "output_type": "display_data"
  291. }
  292. ],
  293. "source": [
  294. "# Create the minimization graph to minimize mu and sigma and run it (minimize does it directly)\n",
  295. "minimum = minimizer.minimize(loss=nll)"
  296. ]
  297. },
  298. {
  299. "cell_type": "code",
  300. "execution_count": 10,
  301. "metadata": {},
  302. "outputs": [],
  303. "source": [
  304. "def plotfitresult(pdf, bounds, nbins, data):\n",
  305. " x = np.linspace(*bounds, num=1000)\n",
  306. " pdf = zfit.run(tot_model.pdf(x, norm_range=bounds) * tot_model.get_yield())\n",
  307. " _ = plt.plot(x, ((bounds[1] - bounds[0])/nbins)*(pdf), \"-r\")"
  308. ]
  309. },
  310. {
  311. "cell_type": "code",
  312. "execution_count": 11,
  313. "metadata": {},
  314. "outputs": [
  315. {
  316. "data": {
  317. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3XmcFNW5//HPM+wiCMiAOIAgKtFoWJyLGK6KbAoqBKMCGhU37nWJGr1eR2LUQESuxiQq9xeCgmiuIGBUUEBE1OCGMhg2g4RFUBYBRUQBQfD5/VE9MAw9Mz3d01O9fN+vV726ltNVT9H6VM2pOueYuyMiItkjJ+wARESkainxi4hkGSV+EZEso8QvIpJllPhFRLKMEr+ISJZR4hcRyTJK/CIiWUaJX0Qky1QPO4BoGjdu7K1atQo7DBGRtLFgwYIv3D03lrIpmfhbtWpFYWFh2GGIiKQNM1sba1lV9YiIZBklfhGRLKPELyKSZZT4RUSyjBK/iEiWKTfxm1kLM3vDzJaZ2UdmdktkfSMzm21mKyKfDUv5/pWRMivM7MrKPgEREamYWO749wK3u/uJQGfgRjM7CSgA5rj78cCcyPJBzKwRcC9wGtAJuLe0C4SIiFSNchO/u2909w8j898Ay4A8oB/wVKTYU8DPonz9HGC2u29196+A2cC5lRG4iIjEp0J1/GbWCugAvA80dfeNEFwcgCZRvpIHfFZseV1knYiIhCTmlrtmdjjwN+BWd99uZjF9Lcq6qKO7m9kQYAhAy5YtYw3rEF1Gvs76bbv2L+c1qMM7Bd3i3p+ISKaJKfGbWQ2CpP+Muz8fWb3JzJq5+0YzawZsjvLVdUDXYsvNgTejHcPdxwBjA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M/ymWb247CDiVWkeqADwR1lcWn5O5VxPpBmv5GZVTOzhcBmYLa7l/obJSPXpVLij3Y1K3kVjKVMqogl1peAVu7+E+A1Dlzh01U6/T6x+pCgKXw74DHgxZDjiYmZHQ78DbjV3beX3BzlKyn9O5VzPmn3G7n7PndvT9DjQSczK9ldalJ/o1RK/BXpAoLyuoBIAeWej7t/6e67I4uPE4xbkM5i+Q3TirtvL/qz3IN2KzXMrHHIYZXJzGoQJMln3P35KEXS6ncq73zS8Tcq4u7bgDeBc0tsSmquS6XEn2ldQJR7PiXqVfsS1F+ms2nAFZG3RjoDX7v7xrCDSoSZHVVUt2pmnQj+nzmkk8FUEYl1LLDM3f9QSrG0+Z1iOZ80/I1yzaxBZL4O0AP4uESxpOa6lBl60TOsC4gYz+dmM+sL7CU4n8GhBRwDM5tI8AZFYzNbB9xL8GAKdx9N0Iq7D7AS2AlcFU6ksYvhnC4CrjezvcAuYGAK32wAdAEuB5ZE6pABhgItIS1/p1jOJ91+o2bAUxYMZpUDTHb3l6sy16nlrohIlkmlqh4REakCSvwiIllGiV9EJMso8YuIZBklfhGRLKPELyKSZZT4RUSyjBK/iEiW+f/20BvYUUtQiAAAAABJRU5ErkJggg==\n",
  318. "text/plain": [
  319. "<Figure size 432x288 with 1 Axes>"
  320. ]
  321. },
  322. "metadata": {
  323. "needs_background": "light"
  324. },
  325. "output_type": "display_data"
  326. }
  327. ],
  328. "source": [
  329. "nbins = 80\n",
  330. "plt.hist(data, bins=nbins, histtype='step', range=bounds);\n",
  331. "plotfitresult(tot_model, bounds, nbins, data)"
  332. ]
  333. },
  334. {
  335. "cell_type": "markdown",
  336. "metadata": {},
  337. "source": [
  338. "## Discovery significance."
  339. ]
  340. },
  341. {
  342. "cell_type": "code",
  343. "execution_count": 12,
  344. "metadata": {},
  345. "outputs": [],
  346. "source": [
  347. "def lossbuilder(model, data, weights=None):\n",
  348. " loss = ExtendedUnbinnedNLL(model=model, data=data, fit_range=[obs]) \n",
  349. " return loss\n",
  350. " \n",
  351. "config = Config(tot_model, data_, lossbuilder, MinuitMinimizer())"
  352. ]
  353. },
  354. {
  355. "cell_type": "code",
  356. "execution_count": 13,
  357. "metadata": {},
  358. "outputs": [
  359. {
  360. "name": "stdout",
  361. "output_type": "stream",
  362. "text": [
  363. "Get fit best values!\n"
  364. ]
  365. },
  366. {
  367. "data": {
  368. "text/html": [
  369. "<hr>"
  370. ]
  371. },
  372. "metadata": {},
  373. "output_type": "display_data"
  374. },
  375. {
  376. "data": {
  377. "text/html": [
  378. "<table>\n",
  379. " <tr>\n",
  380. " <td title=\"Minimum value of function\">FCN = -1145.2067314770634</td>\n",
  381. " <td title=\"Total number of call to FCN so far\">TOTAL NCALL = 36</td>\n",
  382. " <td title=\"Number of call in last migrad\">NCALLS = 36</td>\n",
  383. " </tr>\n",
  384. " <tr>\n",
  385. " <td title=\"Estimated distance to minimum\">EDM = 1.9878782071289407e-06</td>\n",
  386. " <td title=\"Maximum EDM definition of convergence\">GOAL EDM = 5e-06</td>\n",
  387. " <td title=\"Error def. Amount of increase in FCN to be defined as 1 standard deviation\">\n",
  388. " UP = 0.5</td>\n",
  389. " </tr>\n",
  390. "</table>\n",
  391. "<table>\n",
  392. " <tr>\n",
  393. " <td align=\"center\" title=\"Validity of the migrad call\">Valid</td>\n",
  394. " <td align=\"center\" title=\"Validity of parameters\">Valid Param</td>\n",
  395. " <td align=\"center\" title=\"Is Covariance matrix accurate?\">Accurate Covar</td>\n",
  396. " <td align=\"center\" title=\"Positive definiteness of covariance matrix\">PosDef</td>\n",
  397. " <td align=\"center\" title=\"Was covariance matrix made posdef by adding diagonal element\">Made PosDef</td>\n",
  398. " </tr>\n",
  399. " <tr>\n",
  400. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  401. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  402. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  403. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  404. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  405. " </tr>\n",
  406. " <tr>\n",
  407. " <td align=\"center\" title=\"Was last hesse call fail?\">Hesse Fail</td>\n",
  408. " <td align=\"center\" title=\"Validity of covariance\">HasCov</td>\n",
  409. " <td align=\"center\" title=\"Is EDM above goal EDM?\">Above EDM</td>\n",
  410. " <td align=\"center\"></td>\n",
  411. " <td align=\"center\" title=\"Did last migrad call reach max call limit?\">Reach calllim</td>\n",
  412. " </tr>\n",
  413. " <tr>\n",
  414. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  415. " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n",
  416. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  417. " <td align=\"center\"></td>\n",
  418. " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n",
  419. " </tr>\n",
  420. "</table>"
  421. ]
  422. },
  423. "metadata": {},
  424. "output_type": "display_data"
  425. },
  426. {
  427. "data": {
  428. "text/html": [
  429. "<table>\n",
  430. " <tr>\n",
  431. " <td><a href=\"#\" onclick=\"$('#LsvqnqDxbE').toggle()\">+</a></td>\n",
  432. " <td title=\"Variable name\">Name</td>\n",
  433. " <td title=\"Value of parameter\">Value</td>\n",
  434. " <td title=\"Hesse error\">Hesse Error</td>\n",
  435. " <td title=\"Minos lower error\">Minos Error-</td>\n",
  436. " <td title=\"Minos upper error\">Minos Error+</td>\n",
  437. " <td title=\"Lower limit of the parameter\">Limit-</td>\n",
  438. " <td title=\"Upper limit of the parameter\">Limit+</td>\n",
  439. " <td title=\"Is the parameter fixed in the fit\">Fixed?</td>\n",
  440. " </tr>\n",
  441. " <tr>\n",
  442. " <td>0</td>\n",
  443. " <td>lambda</td>\n",
  444. " <td>-1.93314</td>\n",
  445. " <td>0.140801</td>\n",
  446. " <td></td>\n",
  447. " <td></td>\n",
  448. " <td>-4</td>\n",
  449. " <td>-1</td>\n",
  450. " <td>No</td>\n",
  451. " </tr>\n",
  452. " <tr>\n",
  453. " <td>1</td>\n",
  454. " <td>Nsig</td>\n",
  455. " <td>19.4765</td>\n",
  456. " <td>7.12641</td>\n",
  457. " <td></td>\n",
  458. " <td></td>\n",
  459. " <td>-20</td>\n",
  460. " <td>271</td>\n",
  461. " <td>No</td>\n",
  462. " </tr>\n",
  463. " <tr>\n",
  464. " <td>2</td>\n",
  465. " <td>Nbkg</td>\n",
  466. " <td>251.519</td>\n",
  467. " <td>16.7609</td>\n",
  468. " <td></td>\n",
  469. " <td></td>\n",
  470. " <td>0</td>\n",
  471. " <td>298.1</td>\n",
  472. " <td>No</td>\n",
  473. " </tr>\n",
  474. "</table>\n",
  475. "<pre id=\"LsvqnqDxbE\" style=\"display:none;\">\n",
  476. "<textarea rows=\"12\" cols=\"50\" onclick=\"this.select()\" readonly>\n",
  477. "\\begin{tabular}{|c|r|r|r|r|r|r|r|c|}\n",
  478. "\\hline\n",
  479. " & Name & Value & Hesse Error & Minos Error- & Minos Error+ & Limit- & Limit+ & Fixed?\\\\\n",
  480. "\\hline\n",
  481. "0 & $\\lambda$ & -1.93314 & 0.140801 & & & -4.0 & -1 & No\\\\\n",
  482. "\\hline\n",
  483. "1 & Nsig & 19.4765 & 7.12641 & & & -20.0 & 271 & No\\\\\n",
  484. "\\hline\n",
  485. "2 & Nbkg & 251.519 & 16.7609 & & & 0.0 & 298.1 & No\\\\\n",
  486. "\\hline\n",
  487. "\\end{tabular}\n",
  488. "</textarea>\n",
  489. "</pre>"
  490. ]
  491. },
  492. "metadata": {},
  493. "output_type": "display_data"
  494. },
  495. {
  496. "data": {
  497. "text/html": [
  498. "<hr>"
  499. ]
  500. },
  501. "metadata": {},
  502. "output_type": "display_data"
  503. },
  504. {
  505. "data": {
  506. "text/plain": [
  507. "<zfit.minimizers.fitresult.FitResult at 0x1a44fc99b0>"
  508. ]
  509. },
  510. "execution_count": 13,
  511. "metadata": {},
  512. "output_type": "execute_result"
  513. }
  514. ],
  515. "source": [
  516. "config.bestfit"
  517. ]
  518. },
  519. {
  520. "cell_type": "code",
  521. "execution_count": 14,
  522. "metadata": {},
  523. "outputs": [],
  524. "source": [
  525. "calc = FrequentistCalculator(config, ntoysnull=5000)"
  526. ]
  527. },
  528. {
  529. "cell_type": "code",
  530. "execution_count": 15,
  531. "metadata": {},
  532. "outputs": [
  533. {
  534. "name": "stdout",
  535. "output_type": "stream",
  536. "text": [
  537. "Toys successfully read from 'toys_Disco_Nsig.hdf5' !\n"
  538. ]
  539. }
  540. ],
  541. "source": [
  542. "calc.readtoys_from_hdf5(Nsig, \"toys_Disco_Nsig.hdf5\")"
  543. ]
  544. },
  545. {
  546. "cell_type": "code",
  547. "execution_count": 16,
  548. "metadata": {},
  549. "outputs": [],
  550. "source": [
  551. "poinull = POI(Nsig, value=0)"
  552. ]
  553. },
  554. {
  555. "cell_type": "code",
  556. "execution_count": 17,
  557. "metadata": {},
  558. "outputs": [],
  559. "source": [
  560. "discovery_test = Discovery(poinull, calc)"
  561. ]
  562. },
  563. {
  564. "cell_type": "code",
  565. "execution_count": 18,
  566. "metadata": {},
  567. "outputs": [
  568. {
  569. "name": "stdout",
  570. "output_type": "stream",
  571. "text": [
  572. "Compute qobs for the null hypothesis!\n",
  573. "\n",
  574. "p_value for the Null hypothesis = 0.0008\n",
  575. "Significance = 3.155906757921808\n"
  576. ]
  577. }
  578. ],
  579. "source": [
  580. "discovery_test.result();"
  581. ]
  582. },
  583. {
  584. "cell_type": "code",
  585. "execution_count": 19,
  586. "metadata": {},
  587. "outputs": [],
  588. "source": [
  589. "#calc.toys_to_hdf5(\"toys_Disco_Nsig.hdf5\")"
  590. ]
  591. },
  592. {
  593. "cell_type": "code",
  594. "execution_count": 20,
  595. "metadata": {},
  596. "outputs": [
  597. {
  598. "name": "stdout",
  599. "output_type": "stream",
  600. "text": [
  601. "Compute qobs for the null hypothesis!\n"
  602. ]
  603. },
  604. {
  605. "data": {
  606. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEKCAYAAAAb7IIB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/Mg5l5qHq8EZgSETPbXGZ9Pa9W93uBR6ntLtcbzL9Buy0HnsnM1/pOGGvLt/Ja77BZdb+3QZ8xs5yrA9CfBP5FVgPSfQ1ivWmLzHwtM3+bme8Bf96kjjGzbOHIdupK4OFmfVq1fMd7AAzm0hIbgN4zJv4Z8L1mK+1oq8b1vgw8n5l/1qTP3+89RhERS6j9G+1vX5W/V8txETGt9zG1A4A7+nTbAFxdnQ10DvBG73BGBzX962ksLd869evoSuCbDfo8BlwUEV3VMMZFVVtbRe0HnW4ELsvMt5v0Gcx60xZ9jkdd0aSOsXaJmguBFzKzp9HEli7f0T7SPdo3ameh/A21o/g3VW1foraCAkylNhSwC3gKOL2Dtf5jaruWzwLbq9slwLXAtVWf1cBz1M5E2AJ8rIP1nl7V8bOqpt7lW19vUPuRn5eAnwOLO7w+vJ/aBv2EurYxs3ypBdMe4DfU/vL8HLVjUo8DO6v7E6u+i6n9al7vvNdU6/Eu4LMdqnUXtfHy3vW39wy7fwBs7G+96VC9X63Wy2epbdRP6Vtv9fyo7Ugn6q3a7+9dX+v6jsry9ZvAklSo8T4EJEkaJgNAkgplAEhSoQwASSqUASBJhTIAJKlQBoAkFartPwkpjXfVdXCupvaFqH3Atsy8s7NVSUNnAEhDEBGLqF0q4CPU/v88A2zraFHSMBkA0tCcCzya1XVwIqKT14yRRsRjANLQef0UTQgGgDQ0m4ErIuLY6oqMf9TpgqThcghIGoLMfCYiHqZ2JcxfAk92uCRp2LwaqDQCEXErcMizgDQeOQQkSYVyD0CSCuUegCQVygCQpEIZAJJUKANAkgplAEhSoQwASSrU/wcHFg5kpyxMKAAAAABJRU5ErkJggg==\n",
  607. "text/plain": [
  608. "<Figure size 432x288 with 1 Axes>"
  609. ]
  610. },
  611. "metadata": {
  612. "needs_background": "light"
  613. },
  614. "output_type": "display_data"
  615. }
  616. ],
  617. "source": [
  618. "discovery_test.plot_qdist()"
  619. ]
  620. },
  621. {
  622. "cell_type": "code",
  623. "execution_count": null,
  624. "metadata": {},
  625. "outputs": [],
  626. "source": []
  627. }
  628. ],
  629. "metadata": {
  630. "kernelspec": {
  631. "display_name": "Python 3",
  632. "language": "python",
  633. "name": "python3"
  634. },
  635. "language_info": {
  636. "codemirror_mode": {
  637. "name": "ipython",
  638. "version": 3
  639. },
  640. "file_extension": ".py",
  641. "mimetype": "text/x-python",
  642. "name": "python",
  643. "nbconvert_exporter": "python",
  644. "pygments_lexer": "ipython3",
  645. "version": "3.7.3"
  646. }
  647. },
  648. "nbformat": 4,
  649. "nbformat_minor": 2
  650. }