Commit d006d330 authored by Rémy Huet's avatar Rémy Huet 💻
Browse files

Gamma - poisson

parent 0e681c93
......@@ -406,10 +406,56 @@
")\n"
]
},
{
"cell_type": "markdown",
"id": "81826f74",
"metadata": {},
"source": [
"### Distribution Gamma-Poisson\n",
"\n",
"9) Loi gamma :\n",
"\n",
"Définie pour $x \\in [0, +\\infty], \\alpha \\gt 0, \\beta \\gt 0; \\alpha,\\beta$ réels par:\n",
"\n",
"$$f(x; \\alpha, \\beta) = x^{\\alpha - 1}\\frac{\\beta^\\alpha e^{-\\beta x}}{\\Gamma(\\alpha)}$$\n",
"\n",
"Avec\n",
"\n",
"$$\\Gamma(x) = \\int_0^{+\\infty}t^{x-1}e^{-t}dt$$\n",
"\n",
"L'eespéranc est $\\frac{\\alpha}{\\beta}$ le mode $\\frac{\\alpha - 1}{\\beta}$ pour $k \\ge 1$ et la variance $\\frac{\\alpha}{\\beta^2}$e"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "921e5c5b",
"metadata": {},
"outputs": [],
"source": [
"def plot_gamma(a, b):\n",
" min_x = 0\n",
" max_x = spst.gamma.ppf(0.01, a, scale=1/b)\n",
"\n",
" x = np.linspace(min_x, max_x, 100)\n",
"\n",
" fig, ax = plt.subplots()\n",
" ax.plot(x, spst.gamma.pdf(x, a, scale=1/b), label='Distribution of gamma')\n",
" ax.legend()\n",
" ax.set_title('Distribution of gamma law')\n",
"\n",
" plt.show()\n",
"\n",
"interact(plot_gamma,\n",
" a = widgets.FloatSlider(min = 0.1, max = 10, step = 0.1),\n",
" b = widgets.FloatSlider(min = 0.1, max = 10, step = 0.1)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aacbfb71",
"id": "b190fe0d",
"metadata": {},
"outputs": [],
"source": []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment