Created
May 20, 2019 11:55
-
-
Save Cartman0/8403a9df53b4740b052722bedfd1aa9f to your computer and use it in GitHub Desktop.
histogramからKL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "# histogramからKL" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "参考:https://paper.hatenadiary.jp/entry/2018/10/13/164539\n\n厳密な確率密度関数を知らなくても密度化したヒストグラムから\nKL情報量を近似して求められるのでは\n\n" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## 離散分布のKL情報量" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "離散分布のKL情報量\n\n$$\nD_{KL}(p||q) = \\sum_{i} p(i) \\log{(\\frac{p(i)}{q(i)})}\n$$" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "\np, qをヒストグラム密度にする.\n\n" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## histogramの密度化" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "密度化するとビン幅を考慮して合計が1になる.\nこれでヒストグラムを生成するデータ間のデータ数(標本の大きさ)が異なっても考慮できる.\n\nbinの数をnとして,bin幅のベクトルを定義する.\n\n$$\n\\vec{b} = (bin_1 - bin_0, \\cdots, bin_{n}-bin_{n-1})\n=(b_1 , \\cdots, b_{n})\n$$\n\n合計して1より以下を満たす.\n\n$$\n\\sum_i b_i p(i) =1\n$$\n" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "頻度を,bin幅を考慮して総頻度で割れば密度化できるので,\nbinのi番目の密度は,\n\n$$\np(b_i) \n= \\frac{\\text{counts}(b_i)}{\\sum{\\text{counts}(b_i)* b_i}}\n= \\frac{\\text{counts}(b_i)}{\\sum{\\text{counts}(b_i)* (bin_{i} - bin_{i-1})}}\n$$" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## 実装" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "参考:https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### 標準正規分布のヒストグラムからKLを計算" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "import scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nsample1 = stats.norm(loc=0, scale=1).rvs(100)\nsample2 = stats.norm(loc=0, scale=1).rvs(100)\n\nbins = sp.linspace(-4.5, 4.5, 25+1)\nhist1, bins = sp.histogram(sample1, bins, density=True)\nhist1\nhist2, bins = sp.histogram(sample2, bins, density=True)\nhist2\n\ndef create_hists(data1, data2, bins, eps=1e-9):\n hist1, bins = sp.histogram(sample1, bins, density=True)\n hist2, bins = sp.histogram(sample2, bins, density=True)\n hist1 = (hist1 + eps)\n hist1 = hist1 / (sp.diff(bins) * hist1.sum())\n hist2 = (hist2 + eps)\n hist2 = hist2 / (sp.diff(bins) * hist2.sum())\n return hist1, hist2", | |
"execution_count": 15, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# 0が無くなるように再構成\n\nhist1, hist2 = create_hists(sample1, sample2, bins)\nhist1", | |
"execution_count": 16, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "array([9.99999991e-10, 9.99999991e-10, 9.99999991e-10, 9.99999991e-10,\n 9.99999991e-10, 2.77777785e-02, 2.77777785e-02, 1.38888889e-01,\n 8.33333336e-02, 8.33333336e-02, 4.16666664e-01, 5.27777774e-01,\n 4.44444441e-01, 3.61111109e-01, 2.77777776e-01, 1.66666666e-01,\n 1.11111111e-01, 5.55555561e-02, 2.77777785e-02, 9.99999991e-10,\n 9.99999991e-10, 2.77777785e-02, 9.99999991e-10, 9.99999991e-10,\n 9.99999991e-10])" | |
}, | |
"execution_count": 16, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": true, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "hist2.sum()", | |
"execution_count": 17, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "2.7777777777777772" | |
}, | |
"execution_count": 17, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"scrolled": true, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "%matplotlib inline\n\nplt.bar(bins[:-1], hist1, label=\"sample 1\")\nplt.bar(bins[:-1], hist2, label=\"sample 2\")\nplt.legend()\nplt.grid(True)\nplt.show()", | |
"execution_count": 18, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFKRJREFUeJzt3X2QXVWZ7/Hvk9e+mBiqwMoAnZqOmqQSEwRpXiws7aCBYKaSKgemiGBBzWhAJ4zjAApXC5PcWIp6cW6VqJPrRVJ3RoIyWjdiLjgoXb6UYF6Gl4RMMEW1kxanBuIUY4MJRp/7RzrcTqeT3qdzXrpXfz9/nb33Oms/a6f7l9X7nLNOZCaSpLJMaHUBkqT6M9wlqUCGuyQVyHCXpAIZ7pJUIMNdkgpkuEtSgQx3SSqQ4S5JBZrUqhOffvrp2dHR0arT1+yll17iNa95TavLaKnxfg3G+/jBazAaxr99+/YXMvN1w7VrWbh3dHSwbdu2Vp2+Zt3d3XR1dbW6jJYa79dgvI8fvAajYfwR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w68z861bX02r9M/ebM7Nxq5zVgffcVasvAtOBf4qIxyPiK60uqNH6X0A+sgTHbuAb4yXY+10MvA+4pP/f/PH+GaxGMWfuklQgZ+6SVCDDXZIKZLhLUoEMd0kqkOEuSQUy3CWpQIa7JBXIcJekAv0/JdmWl4Uv5uUAAAAASUVORK5CYII=\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "def D_KL(p, q):\n return p.dot(sp.log(p/q))\n \nD_KL(hist1, hist2) ", | |
"execution_count": 19, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "1.1641780255612815" | |
}, | |
"execution_count": 19, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# sample 1000\nimport scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nN = 1000\nsample1 = stats.norm(loc=0, scale=1).rvs(N)\nsample2 = stats.norm(loc=0, scale=1).rvs(N)\n\nhist1, hist2 = create_hists(sample1, sample2, bins, eps=1e-9)\n\nplt.bar(bins[:-1], hist1, label=\"sample 1\")\nplt.bar(bins[:-1], hist2, label=\"sample 2\")\nplt.legend()\nplt.grid(True)\nplt.savefig(\"hist_1000.png\")\nplt.show()\n\nD_KL(hist1, hist2) ", | |
"execution_count": 22, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAG9NJREFUeJzt3X9wXWW97/H3p4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PQdbbD8PnHDjpm5lliKdhMDPLECf9EpJ0naSQNL7asVSapC9L+r+SnpL0Q0nHVzumSpA0T9IOSZ2SllQ7nkqTNEnSI5K2S9oq6dPVjqkaJI2W9BtJ91U7loE46ZeIpEnAHODZasdSJQ8CMyLibcBvgRuqHE/ZpZyiZKTrBf41IqYBZwFXZ/AcAHwa2F7tINJw0i+drwKfoZ+Hz7IgIn6aPI0N8Cj5ZzJGutemKImIV4GDU5RkRkT8KSKeSD6/SD7xZeqpe0kTgfnAt6sdSxpO+iUgaQHwx4h4stqx1IiPAj+pdhAV4GlGCkhqBE4HHqtuJBX3NfIdvr9XO5A0/GL0lCQ9BPxDP5s+B/wPYG5lI6q8I52DiPjfSZnPkf+T/z8qGVuVpJpmJAskjQW+D/xLRPy12vFUiqSLgD9HxCZJLdWOJw0n/ZQi4vz+1kuaCUwGnsxPLMpE4AlJsyPivyoYYtkd7hwcJOly4CLgvZGNe4FTTTMy0kk6mnzC/4+I+EG146mws4EFkv4JqAfeIOl/RcSlVY7rsHyffolJ6gKaI2J4Tj41SMmLdm4B3hMRz1U7nkpI5pn6LfBe4I/kpyz5YERsrWpgFZRMoX4nsDci/qXa8VRT0tO/LiIuqnYsR+IxfSuVbwDHAQ9K2izp9moHVG7JheuDU5RsB+7OUsJPnA1cBpyX/H/fnPR6rUa5p29mliHu6ZuZZYiTvplZhjjpm5lliJO+mVmGOOmbmWWIk76ZWYY46ZuZZYiTvplZhvw/HyKhBLLiTq0AAAAASUVORK5CYII=\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": "0.05993882587548316" | |
}, | |
"execution_count": 22, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "hist1", | |
"execution_count": 66, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "array([9.99999990e-10, 9.99999990e-10, 9.99999990e-10, 4.00000096e-03,\n 1.20000009e-02, 4.40000006e-02, 1.10000000e-01, 1.97999999e-01,\n 2.49999998e-01, 4.23999997e-01, 3.71999997e-01, 3.07999998e-01,\n 1.59999999e-01, 8.60000001e-02, 2.80000007e-02, 4.00000096e-03,\n 9.99999990e-10, 9.99999990e-10, 9.99999990e-10, 9.99999990e-10])" | |
}, | |
"execution_count": 66, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# sample 10000\nimport scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nN = 10000\nsample1 = stats.norm(loc=0, scale=1).rvs(N)\nsample2 = stats.norm(loc=0, scale=1).rvs(N)\n\nhist1, hist2 = create_hists(sample1, sample2, bins, eps=1e-9)\n\nplt.bar(bins[:-1], hist1, label=\"sample 1\")\nplt.bar(bins[:-1], hist2, label=\"sample 2\")\nplt.legend()\nplt.grid(True)\nplt.savefig(\"hist_10000.png\")\nplt.show()\n\nD_KL(hist1, hist2) ", | |
"execution_count": 23, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAG2lJREFUeJzt3X9wXWW97/H3p4Umg8XCoUyObaopmtaWVlsNBQcPBqWl3DLtjANXijjo9RhQqh4RtFwd+sMyB38McmasYsdT4Z57bAX8cSNWKgj7+OOIpMUC/XGroUaI9YzYMkiAFlO/94/scndD2qyd7OyV3efzmumw11rPs/Z3LbI/efLsvddSRGBmZmkYk3cBZmZWPQ59M7OEOPTNzBLi0DczS4hD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0df8NXut+6HQFIjsAj4Rt61ZOHQrwBJi4E/RMSjedcySvwP4Ed5F1EFA12iJKnAKyWpCZgL/CrfSqruVvoGfH/Lu5AsfD39jCTdD/z9AJs+A/xPYEF1K6q+Y52DiPg/xTafoe9P/n+vZm05yXSZkRRIGg98B/iniPhL3vVUi6SLgT9FxFZJrXnXk4VDP6OIuGCg9ZJmA1OBR/suLEoj8IikeRHxX1UsccQd7RwcJulK4GLgXZHGZ4EzXWbkeCfpRPoC/98j4rt511Nl5wKLJf03oB54taT/HRFX5FzXUflz+hUmqQtoiYg0Lj5VVLzRzi3AOyLi6bzrqYbidaZ+A7wL+AN9lyy5PCJ25FpYFRUvoX4HsD8i/invevJUHOlfFxEX513LsXhO3yrlK8DJwH2Stkm6Le+CRlrxjevDlyjZBdyZUuAXnQu8D3hn8f/7tuKo10Ypj/TNzBLikb6ZWUIc+mZmCXHom5klxKFvZpYQh76ZWUIc+mZmCXHom5klxKFvZpaQ/wfT44pH2tD13gAAAABJRU5ErkJggg==\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": "0.008646225250418648" | |
}, | |
"execution_count": 23, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### 二項分布と正規分布" | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# sample 10000\nimport scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nN = 10000\nn = 10\np = 1/2\nsample1 = stats.binom(n, p).rvs(N)\nsample2 = stats.norm(loc=n*p, scale=sp.sqrt(n*p*(1-p))).rvs(N)\n\nbins = sp.linspace(5-8,5+8, 20+1)\nhist1, hist2 = create_hists(sample1, sample2, bins, eps=1e-9)\n\nplt.bar(bins[:-1], hist1, label=\"bin(10, 1/2)\")\nplt.bar(bins[:-1], hist2, label=\"$N(np, np(1-p))$\")\nplt.legend()\nplt.grid(True)\nplt.savefig(\"Bin(10,0.5)_hist.png\")\nplt.show()\n\nD_KL(hist1, hist2) ", | |
"execution_count": 25, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHvpJREFUeJzt3Xt4VPW97/H313AJNWxUtKkSDuDTbJqYIJcUaLU2FFBED6BCjVrFisVeEE/Rp4cWK+BuK7WtVSvdlSqnthubtvYij6JsEXOOdrcVRLkEDhKQYgSUiwcJ9+D3/DGTYZhMkjXJJDO4Pq/n4WF+a/1+a30nDJ+s+c1aa8zdERGRcDgt0wWIiEjHUeiLiISIQl9EJEQU+iIiIaLQFxEJEYW+iEiIKPRFREJEoS8iEiIKfRGREOmU6QISnX322d63b99Y+8CBA5x++umZK6gJqis1qis12VoXZG9tYa/rtdde2+3u57TY0d2z6s+QIUM83ksvveTZSHWlRnWlJlvrcs/e2sJeF7DSA2SspndEREJEoS8iEiIKfRGREMm6D3JFpH0cO3aM2tpaDh8+3Kbt9OjRgw0bNqSpqvQJS125ubkUFBTQuXPnVo1X6IuERG1tLd27d6dv376YWau3s3//frp3757GytIjDHW5O3v27KG2tpZ+/fq1ahua3hEJicOHD9OzZ882Bb5klpnRs2fPNr1bU+iLhIgC/9TX1n/DQKFvZmPMbKOZ1ZjZzCTrv2pma83sDTN7xcyK49Z9Ozpuo5ld1qZqRUSkTVqc0zezHGA+MBqoBVaY2WJ3Xx/X7Ul3/0W0/zjgAWBMNPwrgAuA84BlZvav7n48zc9DRFLUd+azad3e1nlXNL9+61auvPJK1q1b12jdrbfeyowZMyguLk4y8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iIKfRGREFHoi4iEyP8HqmlCIY5XYI4AAAAASUVORK5CYII=\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": "0.31268925739647135" | |
}, | |
"execution_count": 25, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# sample 10000\nimport scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nN = 10000\nn = 100\np = 1/2\nsample1 = stats.binom(n, p).rvs(N)\nsample2 = stats.norm(loc=n*p, scale=sp.sqrt(n*p*(1-p))).rvs(N)\n\n\nbins = sp.linspace(n*p-20,n*p+20, 20+1)\nhist1, bins = sp.histogram(sample1, bins, density=True)\nhist2, bins = sp.histogram(sample2, bins, density=True)\n\neps = 1e-9\n\nhist1 = (hist1 + eps)\nhist1 = hist1 / (sp.diff(bins) * hist1.sum())\nhist2 = (hist2 + eps)\nhist2 = hist2 / (sp.diff(bins) * hist2.sum())\n\nplt.bar(bins[:-1], hist1, label=\"$bin(100, 1/2)$\")\nplt.bar(bins[:-1], hist2, label=\"$N(np, np(1-p))$\")\nplt.legend()\nplt.grid(True)\nplt.show()\n\nD_KL(hist1, hist2) ", | |
"execution_count": 96, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3X90VeWd7/H31/AjtqGhRc2o0QIFKQgKkoJ3bL1J8Qfae8UWGEO5ohUX09XSa6cz917aWxVcdUZ6q7Rr6UxLC16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Y+i1LfMXSdx8hMTtheVJZTn2nO3JFRCJkUAzviIhIOEr6IiIRoqQvIhIhSvoiIhGipC8iEiFK+iIiEaKkLyISIUr6IiIR8v8BYXvDNfgm2qQAAAAASUVORK5CYII=\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": "0.005019163960424132" | |
}, | |
"execution_count": 96, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "n*p, n*p*(1-p)", | |
"execution_count": 81, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "(50.0, 25.0)" | |
}, | |
"execution_count": 81, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "# sample 10000\n# n = 10000\nimport scipy as sp\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\n\nN = 10000\nn = 10000\np = 1/2\nsample1 = stats.binom(n, p).rvs(N)\nsample2 = stats.norm(loc=n*p, scale=sp.sqrt(n*p*(1-p))).rvs(N)\n\n\nbins = sp.linspace(n*p-200,n*p+200, 200+1)\nhist1, hist2 = create_hists(sample1, sample2, bins, eps=1e-9)\n\nplt.bar(bins[:-1], hist1, label=\"$Bin(10000, 1/2)$\")\nplt.bar(bins[:-1], hist2, label=\"$N(np, np(1-p))$\")\nplt.legend()\nplt.grid(True)\nplt.savefig(\"Bin(10000,0.5)_hist.png\")\nplt.show()\n\nD_KL(hist1, hist2) ", | |
"execution_count": 28, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0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98h0suuYSTTjqJ3/3udwAsWbKEGTNmtPZ16aWXctxxx7Vbxrp16xg9ejSnnXYaxcXFzJ49m5deeint+o76SiZZTAC1tbWcfvrpnHLKKXzuc58DYNCgQYwdO5adO3cCcOWVV7JkyZJ0N2talBBEpEeorq7mlltuYezYsZSVlfGrX/2KwYMHU1VVxYQJEwCoqqpi6NChvPbaazzyyCMsWbKEpqYmtm7dSiqPxt+5cyennnpq63RpaSk7d+5Mu76jvjKxcuVKpk2b1qZu+/btbNy4kfPPPx+AcePGsX79+oz6T5USgkg6dII5J3bs2MGJJ55IRUUFtbW1PPzww3zve9+jsbGRgwcPMmTIEPbv38/evXu5++67ATh06BBDhw5l9+7dDB06NKXlRE+DbsvM0q7vqK9MrFq1qk1CaGhoYObMmfz0pz9l8ODBABQVFVFcXMy+ffsyWkYqlBBEpNtVVFQwbty41umzzz6b999/n+rq6tb66upqysrKWs8TVFRUMH78eI4++uiU79AtLS1lx44drdP19fV85jOfSbu+o77StX//fv72t7+1znvw4EFmzpzJjTfeyLXXXtum7YEDBygpKUl7GalSQhCRbldZWcnYsWOB6Jv3U089xZQpU6isrOSss84CosNF55xzTus8FRUVnHXWWRx77LE0NzenlBQ+//nP8+6777Jt2zaamppYunQpV111Vdr1HfUFMHny5JQPH5WXlzNp0qTWdZ8zZw5jx47lnnvuadNuz549nHDCCV16eF1ndNmpSBaNnP9yypdZ9lTdEX9lZSWvvvoqL7/8MmbGBRdcwI9+9CO++93vth5Dr6ysbC1DlCDGjx8PwBe/+EVef/11pkyZAsD111/PmjVr2L17N6Wlpdx3333MmTOH/v3787Of/YypU6fS3NzM7bffzplnngnQWn/w4EHmzp3brj6+fbK+Dh8+TF1dXbsTyMliWrlyJddddx0Av//973n66aeZMGFCa/J74IEHmD59Oq+99hrTp0/P1Z8gkurQaj3hR0No5k9Pjcu9G2JbODhxOU55ebmP+ObyPASUns62V01NTX4CifPxxx9nra8NGzb4TTfdlJW+uhpXZWWl33333Sm3P/fcc72pqanTdl/+8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0dMGyMaxGhLiHtiD4nrzpjt9SZwUcxr04mu5toCfDsK6jsiAAAAi0lEQVQL8ZwWlvNOWOa3Q/0woiT1bvjd8mGRl22WQVx52WYdxHUN0TfYA8BfgVWd/e91Z1xEFzC0bK8NwJdj+poIVIW4fkZItDmIrY7onMCm8PPzfGwz3aksIiJAYZ9DEBGRLFJCEBERQAlBREQCJQQREQGUEEREJFBCEBERQAlBREQCJQQREQHg/wMw/wza6XZpngAAAABJRU5ErkJggg==\n", | |
"text/plain": "<Figure size 432x288 with 1 Axes>" | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
}, | |
{ | |
"data": { | |
"text/plain": "0.016068499410022707" | |
}, | |
"execution_count": 28, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "bins", | |
"execution_count": 111, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "array([4800. , 4813.33333333, 4826.66666667, 4840. ,\n 4853.33333333, 4866.66666667, 4880. , 4893.33333333,\n 4906.66666667, 4920. , 4933.33333333, 4946.66666667,\n 4960. , 4973.33333333, 4986.66666667, 5000. ,\n 5013.33333333, 5026.66666667, 5040. , 5053.33333333,\n 5066.66666667, 5080. , 5093.33333333, 5106.66666667,\n 5120. , 5133.33333333, 5146.66666667, 5160. ,\n 5173.33333333, 5186.66666667, 5200. ])" | |
}, | |
"execution_count": 111, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
} | |
], | |
"metadata": { | |
"hide_input": false, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3", | |
"language": "python" | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.7.0", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": true, | |
"sideBar": true, | |
"skip_h1_title": false, | |
"base_numbering": 1, | |
"title_cell": "Table of Contents", | |
"title_sidebar": "Contents", | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": true, | |
"toc_window_display": true | |
}, | |
"gist": { | |
"id": "", | |
"data": { | |
"description": "histogramからKL", | |
"public": true | |
} | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment