{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# chapter 5 공산과 가산 (Odds and Addends)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.1 공산" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- \"공산은 3대 1입니다.\"\n", "\n", "\n", "- 어떤 사건의 **승산(odds in favor)**은 이 사건이 **일어나지 않을때의 확률**과 **일어났을때의 확률**의 **비율**이다.\n", "\n", "\n", "- 예) 우리팀 승률 75% --> 3:1\n", "\n", "\n", "- 확률이 낮은 경우, 승산보다 반대 형식의 공산으로 표기하는 경우가 더 흔하다.\n", "- 예) 내 말이 이길 확률 10% --> 공산 9:1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-----------------------------------\n", ">http://en.wikipedia.org/wiki/Odds\n", "\n", ">- **odds for** -- the likelihood that a particular event will take place. \n", ">- **odds against** -- the likelihood that a particular event will **not** take place. \n", "\n", "-------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "- 확률과 공산은 **동일한 정보를 다르게 표기**하는 법이다." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from __future__ import division\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def Odds(p):\n", " return p / (1-p)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def Probability(o):\n", " return o / (o+1)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# 분모, 분자 아는 경우\n", "\n", "def Probability2(yes, no):\n", " return yes / (yes + no)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "< 예 >\n", "\n", "경마장에서 20%의 사람만 자기 말이 이길 거라고 생각하고, 80%의 사람들은 아닐거라고 생각한다면, 공산은 20:80 혹은 1:4" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.25\n" ] } ], "source": [ "p=0.2\n", "o = Odds(p)\n", "print o" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.2\n" ] } ], "source": [ "p1= Probability(o)\n", "print p1" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.2" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Probability2(20,80) # 분모 = 80, 분자 = 20" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.2 베이즈 이론의 공산 형태" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**확률형태** 베이즈 이론" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$p(H|D) = \\frac{p(H)p(D|H)}{p(D)}$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A, B 라는 두 개의 가설이 있을때 사후확률비" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\\frac{p(A|D)}{p(B|D)} = \\frac{p(A)p(D|A)}{p(B)p(D|B)} $$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A, B 가 상호 배제적이며 전체 포괄적이라면, $p(B) = 1 - p(A)$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A 에 대한 공산을 $ o(A) $ 로 쓰면, " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "> $$ o(A|D) = o(A) \\frac{p(D|A)}{p(D|B)} $$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "즉, **사후 공산**은 **사전공산**과 **우도비**의 곱\n", "\n", "- 베이즈 이론을 **공산형태**로 나타낸것이다." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.3 올리버의 혈액형" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">< 문제 >\n", "\n", ">범죄현장에서 두 사람의 혈흔을 발견.\n", "\n", ">두 혈흔의 혈액형은 'O'형 (인구의 60% 빈도로 나타남) 과 'AB'형 (인구의 1%).\n", "\n", ">용의자 올리버는 'O'형\n", "\n", ">이 데이터(범죄 현장의 혈흔의 혈액형)가 올리버가 범인중 한명이라는 질문에 대한 증거인가?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$ o(A|D) = o(A) \\frac{p(D|A)}{p(D|B)} $$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$ o(A) $ 로 나누면, \n", ">$$ \\frac{o(A|D)}{o(A)} =\\frac{p(D|A)}{p(D|B)} $$\n", "\n", ">왼쪽 항목 : **사후공산과 사전공산의 비**\n", "\n", ">오른쪽 항목 : **우도비 (베이즈 요인)**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 베이즈요인(Bayes factor) > 1\n", "\n", " $ \\frac{p(D|A)}{p(D|B)} > 1 $\n", "\n", " ; 데이터는 B의 가정보다는 **A의 가정에 가깝다**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 공산비 = ( 사후공산 / 사전공산 ) > 1\n", "\n", " $ \\frac{o(A|D)}{o(A)} > 1 $\n", " \n", " ; 테이터 상에서 **전보다 공산이 커졌다.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 베이즈요인 = 1 \n", "\n", " ; 데이터는 각 가설에서 경우가 동일하므로 **공산은 변하지 않는다.**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">< 문제 풀이 >\n", "\n", ">* 올리버가 범인이라면, \n", "\n", "> 현장 'O'형은 올리버이고, 이때 데이터 확률은 'AB'형 확률 1% 와 동일.\n", "\n", "> ; 1%\n", "

\n", "\n", ">* 범인 아니라면,\n", "\n", "> 임의의 'O'형 확률 and 임의의 'AB'형 확률\n", "\n", "> --> 첫번째 사람이 'O'형이고, 두번째 사람이 'AB'형 \n", "> or 첫번째 사람이 'AB' 형이고, 두번째 사람이 'O'형\n", "\n", "> ; 0.6*0.01 + 0.6*0.01 = 1.2%" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.4 가산 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The fundamental operation of Bayesian statistics is **Update**, which takes a **prior distribution**\n", "and a set of **data**, and produces a **posterior distribution**.\n", "\n", " --> 사전분포와 데이터로 사후분포를 생성!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "실제 문제는 보통 정규화, **덧셈**과 **최댓값**, 최솟값, 이런 연산을 조합한 기타 수치 연산 등의 많은 연산을 포함하고 있다." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "이 장(5장)에서는 덧셈과 최댓값에 대해서 설명한다." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "던전 앤 드래곤 게임 예\n", "\n", "게임시작하기 전에, 플레이어는 6면체 주사위 세개를 굴린 후 이 값을 더해서 캐릭터 속성값(체력, 지능, 등)을 생성한다.\n", "\n", "3 주사위의 합의 분포는?\n", "\n", "- 시뮬레이션 - 하나의 주사위에 대한 분포를 나타내는 Pmf 가 주어졌을때, 이를 사용해서 랜덤 샘플을 만들고, 더해서, 시뮬레이션으로 만들어진 값의 합에 대한 분포를 구한다.\n", "\n", "\n", "- 나열 (enumeration) - 주어진 두 개의 Pmf를 사용하여, 모든 가능한 수의 쌍을 나열하고, 이 합의 분포를 계산한다.
\n", " ; (첫번째 pmf + 두번째 pmf) + 세번째 pmf\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing ./images/dungeons3.pdf\n", "Writing ./images/dungeons3.eps\n", "Writing ./images/dungeons3.png\n", "3 0.002\n", "4 0.017\n", "5 0.017\n", "6 0.046\n", "7 0.062\n", "8 0.095\n", "9 0.125\n", "10 0.123\n", "11 0.132\n", "12 0.127\n", "13 0.099\n", "14 0.075\n", "15 0.044\n", "16 0.022\n", "17 0.014\n", "3 0.00462962962963\n", "4 0.0138888888889\n", "5 0.0277777777778\n", "6 0.0462962962963\n", "7 0.0694444444444\n", "8 0.0972222222222\n", "9 0.115740740741\n", "10 0.125\n", "11 0.125\n", "12 0.115740740741\n", "13 0.0972222222222\n", "14 0.0694444444444\n", "15 0.0462962962963\n", "16 0.0277777777778\n", "17 0.0138888888889\n", "18 0.00462962962963\n", "Writing ./images/dungeons1.pdf\n", "Writing ./images/dungeons1.eps\n", "Writing ./images/dungeons1.png\n", "3 9.84640042005e-15\n", "4 4.03210097201e-11\n", "5 9.80606956393e-09\n", "6 6.20323226463e-07\n", "7 1.74701297953e-05\n", "8 0.000285572333648\n", "9 0.00247724167357\n", "10 0.0128440856934\n", "11 0.0439796447754\n", "12 0.105590541894\n", "13 0.18102225454\n", "14 0.212013521417\n", "15 0.194224527556\n", "16 0.141452169514\n", "17 0.0786340868805\n", "18 0.0274582534226\n", "Writing ./images/dungeons2.pdf\n", "Writing ./images/dungeons2.eps\n", "Writing ./images/dungeons2.png\n" ] }, { "data": { "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# %load ./src/dungeons.py\n", "\"\"\"This file contains code for use with \"Think Bayes\",\n", "by Allen B. Downey, available from greenteapress.com\n", "\n", "Copyright 2012 Allen B. Downey\n", "License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html\n", "\"\"\"\n", "\n", "import random\n", "\n", "from src import thinkbayes\n", "from src import thinkplot\n", "\n", "FORMATS = ['pdf', 'eps', 'png']\n", "\n", "\n", "class Die(thinkbayes.Pmf):\n", " \"\"\"Represents the PMF of outcomes for a die.\"\"\"\n", "\n", " def __init__(self, sides, name=''):\n", " \"\"\"Initializes the die.\n", "\n", " sides: int number of sides\n", " name: string\n", " \"\"\"\n", " thinkbayes.Pmf.__init__(self, name=name)\n", " for x in xrange(1, sides+1):\n", " self.Set(x, 1)\n", " self.Normalize()\n", "\n", "\n", "def PmfMax(pmf1, pmf2):\n", " \"\"\"Computes the distribution of the max of values drawn from two Pmfs.\n", "\n", " pmf1, pmf2: Pmf objects\n", "\n", " returns: new Pmf\n", " \"\"\"\n", " res = thinkbayes.Pmf()\n", " for v1, p1 in pmf1.Items():\n", " for v2, p2 in pmf2.Items():\n", " res.Incr(max(v1, v2), p1*p2)\n", " return res\n", " \n", "\n", "def main():\n", " pmf_dice = thinkbayes.Pmf()\n", " pmf_dice.Set(Die(4), 5)\n", " pmf_dice.Set(Die(6), 4)\n", " pmf_dice.Set(Die(8), 3)\n", " pmf_dice.Set(Die(12), 2)\n", " pmf_dice.Set(Die(20), 1)\n", " pmf_dice.Normalize()\n", "\n", " mix = thinkbayes.Pmf()\n", " for die, weight in pmf_dice.Items():\n", " for outcome, prob in die.Items():\n", " mix.Incr(outcome, weight*prob)\n", "\n", " mix = thinkbayes.MakeMixture(pmf_dice)\n", "\n", " colors = thinkplot.Brewer.Colors()\n", " thinkplot.Hist(mix, width=0.9, color=colors[4])\n", " thinkplot.Save(root='./images/dungeons3',\n", " xlabel='Outcome',\n", " ylabel='Probability',\n", " formats=FORMATS)\n", "\n", " random.seed(17)\n", "\n", " d6 = Die(6, 'd6')\n", "\n", " dice = [d6] * 3\n", " three = thinkbayes.SampleSum(dice, 1000)\n", " three.name = 'sample'\n", " three.Print()\n", "\n", " three_exact = d6 + d6 + d6\n", " three_exact.name = 'exact'\n", " three_exact.Print()\n", "\n", " thinkplot.PrePlot(num=2)\n", " thinkplot.Pmf(three)\n", " thinkplot.Pmf(three_exact, linestyle='dashed')\n", " thinkplot.Save(root='./images/dungeons1',\n", " xlabel='Sum of three d6',\n", " ylabel='Probability',\n", " axis=[2, 19, 0, 0.15],\n", " formats=FORMATS)\n", "\n", " thinkplot.Clf()\n", " thinkplot.PrePlot(num=1)\n", " \n", " # compute the distribution of the best attribute the hard way\n", " best_attr2 = PmfMax(three_exact, three_exact)\n", " best_attr4 = PmfMax(best_attr2, best_attr2)\n", " best_attr6 = PmfMax(best_attr4, best_attr2)\n", " # thinkplot.Pmf(best_attr6)\n", "\n", " # and the easy way\n", " best_attr_cdf = three_exact.Max(6)\n", " best_attr_cdf.name = ''\n", " best_attr_pmf = thinkbayes.MakePmfFromCdf(best_attr_cdf)\n", " best_attr_pmf.Print()\n", "\n", " thinkplot.Pmf(best_attr_pmf)\n", " thinkplot.Save(root='./images/dungeons2',\n", " xlabel='Sum of three d6',\n", " ylabel='Probability',\n", " axis=[2, 19, 0, 0.23],\n", " formats=FORMATS)\n", " \n", "\n", "\n", "if __name__ == '__main__':\n", " main()\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3 0.002\n", "4 0.017\n", "5 0.017\n", "6 0.046\n", "7 0.062\n", "8 0.095\n", "9 0.125\n", "10 0.123\n", "11 0.132\n", "12 0.127\n", "13 0.099\n", "14 0.075\n", "15 0.044\n", "16 0.022\n", "17 0.014\n", "---------- simulation ---- \n", "3 0.00462962962963\n", "4 0.0138888888889\n", "5 0.0277777777778\n", "6 0.0462962962963\n", "7 0.0694444444444\n", "8 0.0972222222222\n", "9 0.115740740741\n", "10 0.125\n", "11 0.125\n", "12 0.115740740741\n", "13 0.0972222222222\n", "14 0.0694444444444\n", "15 0.0462962962963\n", "16 0.0277777777778\n", "17 0.0138888888889\n", "18 0.00462962962963\n", "--------- enumeration ----- \n", "Writing ./images/dungeons1.pdf\n", "Writing ./images/dungeons1.eps\n", "Writing ./images/dungeons1.png\n" ] }, { "data": { "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import random\n", "import matplotlib.pyplot as pyplot\n", "\n", "from src import thinkbayes\n", "from src import thinkplot\n", "\n", "\n", "FORMATS = ['pdf', 'eps', 'png']\n", "\n", "\n", "class Die(thinkbayes.Pmf):\n", " \"\"\"Represents the PMF of outcomes for a die.\"\"\"\n", "\n", " def __init__(self, sides, name=''):\n", " \"\"\"Initializes the die.\n", "\n", " sides: int number of sides\n", " name: string\n", " \"\"\"\n", " thinkbayes.Pmf.__init__(self, name=name)\n", " for x in xrange(1, sides+1):\n", " self.Set(x, 1)\n", " self.Normalize()\n", "\n", "\n", "def PmfMax(pmf1, pmf2):\n", " \"\"\"Computes the distribution of the max of values drawn from two Pmfs.\n", "\n", " pmf1, pmf2: Pmf objects\n", "\n", " returns: new Pmf\n", " \"\"\"\n", " res = thinkbayes.Pmf()\n", " for v1, p1 in pmf1.Items():\n", " for v2, p2 in pmf2.Items():\n", " res.Incr(max(v1, v2), p1*p2)\n", " return res\n", " \n", "\n", "def main():\n", " random.seed(17)\n", "\n", " d6 = Die(6, 'd6') # 6 면체 주사위 생성, simulation, 하나의 주사위 분포 Pmf\n", "\n", " dice = [d6] * 3\n", " three = thinkbayes.SampleSum(dice, 1000) # 주사위를 1000 번 굴린 샘플값 생성\n", " three.name = 'sample (simulation)'\n", " three.Print()\n", "\n", " print '---------- simulation ---- '\n", " \n", " three_exact = d6 + d6 + d6 # 나열 (enumeration)\n", " three_exact.name = 'exact (enumeration)'\n", " three_exact.Print()\n", "\n", " print '--------- enumeration ----- '\n", " \n", " thinkplot.PrePlot(num=2)\n", " \n", " thinkplot.Pmf(three) # simulation\n", " thinkplot.Pmf(three_exact, linestyle='dashed') # 나열 (enumeration)\n", " \n", " # thinkplot.Show() # image view\n", " thinkplot.Save(root='./images/dungeons1',\n", " xlabel='Sum of three d6',\n", " ylabel='Probability',\n", " axis=[2, 19, 0, 0.15],\n", " formats=FORMATS)\n", " \n", " \n", "if __name__ == '__main__':\n", " main()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.5 최댓값" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "던전 앤 드래곤 캐릭터 만들때, 특히 캐릭터의 최고 속성이 중요하다. 따라서 속성의 **최댓값 분포**가 궁금하다." ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "3 가지 방법\n", "\n", "- 시뮬레이션 (Simulation) ; sum 대신 max 사용, 앞 코드와 비슷.\n", "\n", "- 나열 (enumeration)\n", "\n", "- 멱법 (Exponentiation) ; Pmf 를 Cdf(누적분포함수)로 바꿀때, 최댓값에서 Cdf를 구하는 알고리즘." ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Warning: Brewer ran out of colors.\n" ] }, { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEACAYAAABS29YJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAIABJREFUeJztnXe8XFXVv5+VRglI10BCExhAkOoggmIUlAgIAiIdA/qK\n", "Mqjw8v5AWiYDSBFQXmFQqgUBQUR6F+KL1AHpBIbQQ+89yU2yfn/sfe7sM5ne7531fJgP5+zZZ599\n", "b+58Z5+1VxFVxTAMwxjejOj2BAzDMIz2Y2JvGIbRB5jYG4Zh9AEm9oZhGH2Aib1hGEYfYGJvGIbR\n", "B1QVexGZJCJPiMhTInJYiff3FJGHRORhEblDRNYL3nvOtz8gIve2evKGYRhGbUglP3sRGQk8CWwF\n", "vATkgN1VdXrQ50vA46r6nohMAqaq6qb+vWeBjVX17Tb+DIZhGEYVqq3sNwFmqOpzqjoA/BXYIeyg\n", "qnep6nv+9B5gQtEY0pKZGoZhGA1TTezHAy8G5zN9Wzl+AFwXnCtwi4jcJyL/1dgUDcMwjGYZVeX9\n", "mnMpiMjXgP2AzYPmzVX1FRFZDrhZRJ5Q1dsbmKdhGIbRBNXE/iVgxeB8RdzqPobflD0HmKSq70Tt\n", "qvqK//8bIvIPnFno9qJrLTmPYRhGA6hq7WZyVS37wn0ZPA2sAowBHgTWLuqzEjAD2LSofVFgcX88\n", "FrgD+GaJe2ilOfTKC7fx3PV52DxtnkNxjjbPtsxT6+lfcWWvqnNF5EDgRmAkcJ6qTheR/f37ZwFT\n", "gKWA34kIwICqbgKMAy73baOAC1X1ppq/hQzDMIyWUc2Mg6peD1xf1HZWcPxD4IclrnsG2KAFczQM\n", "wzCaxCJoa2datydQI9O6PYEamdbt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hJvVdV9uj2vYlT1VeBFEYlqzW4FNJTlsc08j8uIuoj/998Kt/Hdq1yFK5OI/38vLkii\n", "VOL/D9ihExlPG0FVH1HVz6jqqv7zNBPYSFV78Qv0Clz9ZvxnaoyqvtXdKZXkZRH5qj/+Om5zvjyq\n", "2pUXrsDEfFye8Qf8a1K35lPDfL8KXNXteVSY3/q4XPYP4VYlS3R7TmXmORW3Gf8IbtNzdLfn5Od1\n", "MW4fYQ4uodq+wNK4FMl5nMfLkj04z/2Ap3BfpNHn6Mwemufs6PdZ9P4zwNK9OE9cqpcL/N/o/cDE\n", "Hppn+Pe5OS7LwYPAXcCGlcawoCrDMIw+oOsbtIZhGEb7MbE3DMPoA0zsDcMw+gATe8MwjD7AxN4w\n", "DKMPMLE3DMPoA0zsDcMw+gATe8MwjD7g/wMkXytORp7CLgAAAABJRU5ErkJggg==\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "-------------------------------- \n", "3 9.84640042005e-15\n", "4 4.03210097201e-11\n", "5 9.80606956393e-09\n", "6 6.20323226463e-07\n", "7 1.74701297953e-05\n", "8 0.000285572333648\n", "9 0.00247724167357\n", "10 0.0128440856934\n", "11 0.0439796447754\n", "12 0.105590541894\n", "13 0.18102225454\n", "14 0.212013521417\n", "15 0.194224527556\n", "16 0.141452169514\n", "17 0.0786340868805\n", "18 0.0274582534226\n", "Writing ./images/dungeons2.pdf\n", "Writing ./images/dungeons2.eps\n", "Writing ./images/dungeons2.png\n" ] }, { "data": { "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import random\n", "import matplotlib.pyplot as pyplot\n", "\n", "from src import thinkbayes\n", "from src import thinkplot\n", "\n", "FORMATS = ['pdf', 'eps', 'png']\n", "\n", "\n", "class Die(thinkbayes.Pmf):\n", " \"\"\"Represents the PMF of outcomes for a die.\"\"\"\n", "\n", " def __init__(self, sides, name=''):\n", " \"\"\"Initializes the die.\n", "\n", " sides: int number of sides\n", " name: string\n", " \"\"\"\n", " thinkbayes.Pmf.__init__(self, name=name)\n", " for x in xrange(1, sides+1):\n", " self.Set(x, 1)\n", " self.Normalize()\n", "\n", "\n", "def PmfMax(pmf1, pmf2):\n", " \"\"\"Computes the distribution of the max of values drawn from two Pmfs.\n", "\n", " pmf1, pmf2: Pmf objects\n", "\n", " returns: new Pmf\n", " \"\"\"\n", " res = thinkbayes.Pmf()\n", " for v1, p1 in pmf1.Items():\n", " for v2, p2 in pmf2.Items():\n", " res.Incr(max(v1, v2), p1*p2)\n", " return res\n", " \n", "\n", "def main():\n", " \n", " random.seed(17)\n", "\n", " d6 = Die(6, 'd6') # 6 면체 주사위 생성, 하나의 주사위 분포 Pmf\n", "\n", " three_exact = d6 + d6 + d6 # 나열 (enumeration)\n", " \n", " thinkplot.Clf()\n", " thinkplot.PrePlot(num=1)\n", " \n", " # compute the distribution of the best attribute the hard way\n", " best_attr2 = PmfMax(three_exact, three_exact) # 세 주사위를 2번 굴렸을때의 최댓값 분포\n", " best_attr4 = PmfMax(best_attr2, best_attr2) # 세 주사위를 4번 굴렸을때의 최댓값 분포\n", " best_attr6 = PmfMax(best_attr4, best_attr2) # 세 주사위를 6번 굴렸을때의 최댓값 분포\n", " thinkplot.Pmf(best_attr2)\n", " thinkplot.Pmf(best_attr4)\n", " thinkplot.Pmf(best_attr6)\n", " thinkplot.Show() # image view\n", "\n", " print '-------------------------------- '\n", " \n", " # and the easy way\n", " best_attr_cdf = three_exact.Max(6) # 세 주사위를 6번 굴렸을때의 최댓값 분포\n", " best_attr_cdf.name = ''\n", " best_attr_pmf = thinkbayes.MakePmfFromCdf(best_attr_cdf)\n", " best_attr_pmf.Print()\n", "\n", " thinkplot.Pmf(best_attr_pmf)\n", " \n", " # thinkplot.Show() # image view\n", " \n", " thinkplot.Save(root='./images/dungeons2',\n", " xlabel='Sum of three d6',\n", " ylabel='Probability',\n", " axis=[2, 19, 0, 0.23],\n", " formats=FORMATS)\n", " \n", "\n", "\n", "if __name__ == '__main__':\n", " main()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " #### 그림 5-2 세 주사위를 6번 굴렸을때의 최댓값 분포\n", " \n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 누적분포함수 (cumulative distribution function)\n", "\n", "$$ CDF(x) = p(X \\le x) $$\n", "\n", "여기서 $X$ 는 \"이 분포에서 임의로 선택한 값\"의 뜻을 갖는 랜덤 변수다." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Pmf를 Cdf로 변경하면 동일한 계산을 훨씬 빠르게 할 수 있다!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">$CDF_1$ 에서 $X$를 고르고 $CDF_2$ 에서 $Y$를 고르고, 최댓값 $Z = max(X,Y)$ 를 계산하자!\n", "\n", ">$X$, $Y$ 선택이 독립적이면,\n", "\n", ">$$CDF_3(z) = CDF_1(z)CDF_2(z)$$\n", "\n", ">이때 $CDF_3$ 의 분포는 $Z$ 의 분포다.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ ">< 예 > Z 가 5 이하인 경우는 얼마일까? 이 경우 X와 Y 모두 5 이하여야 한다.\n", ">$$CDF_3(5) = CDF_1(5)CDF_2(5)$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 동일한 분포에서 k개의 값을 가져오는 특수한 경우는 다음과 같은 식이 성립한다.\n", "\n", "$$CDF_k(z) = CDF_1(z)^k$$\n", "\n", "k개의 값중 최댓값의 분포를 찾으면, 주어진 Cdf 의 확률을 나열한 후 이를 k회 곱하면 된다. (**멱법**)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.6 혼합" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "다음과 같은 주사위 한상자가 있다. 상자에서 주사위를 골라 굴렸다. 이 때 결괏값의 분포는?\n", "\n", ">5 4면체 주사위\n", "\n", ">4 6면체 주사위\n", "\n", ">3 8면체 주사위\n", "\n", ">2 12면체 주사위\n", "\n", ">1 20면체 주사위" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 어떤 주사위인지를 모를 경우, 결과 분포는 서로 다른 범위의 균등 분포의 혼합 형태로 나타난다.\n", "- PMF 의 형태로 분포를 간단하게 계산할 수 있다." ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing ./images/dungeons3.pdf\n", "Writing ./images/dungeons3.eps\n", "Writing ./images/dungeons3.png\n" ] }, { "data": { "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import random\n", "import matplotlib.pyplot as pyplot\n", "\n", "from src import thinkbayes\n", "from src import thinkplot\n", "\n", "FORMATS = ['pdf', 'eps', 'png']\n", "\n", "\n", "class Die(thinkbayes.Pmf):\n", " \"\"\"Represents the PMF of outcomes for a die.\"\"\"\n", "\n", " def __init__(self, sides, name=''):\n", " \"\"\"Initializes the die.\n", "\n", " sides: int number of sides\n", " name: string\n", " \"\"\"\n", " thinkbayes.Pmf.__init__(self, name=name)\n", " for x in xrange(1, sides+1):\n", " self.Set(x, 1)\n", " self.Normalize()\n", "\n", "\n", "def PmfMax(pmf1, pmf2):\n", " \"\"\"Computes the distribution of the max of values drawn from two Pmfs.\n", "\n", " pmf1, pmf2: Pmf objects\n", "\n", " returns: new Pmf\n", " \"\"\"\n", " res = thinkbayes.Pmf()\n", " for v1, p1 in pmf1.Items():\n", " for v2, p2 in pmf2.Items():\n", " res.Incr(max(v1, v2), p1*p2)\n", " return res\n", " \n", "\n", "def main():\n", " pmf_dice = thinkbayes.Pmf()\n", " pmf_dice.Set(Die(4), 5) # 각 주사위의 확률을 알아서 가중치 부여한다.\n", " pmf_dice.Set(Die(6), 4)\n", " pmf_dice.Set(Die(8), 3)\n", " pmf_dice.Set(Die(12), 2)\n", " pmf_dice.Set(Die(20), 1)\n", " pmf_dice.Normalize()\n", "\n", " mix = thinkbayes.Pmf()\n", " for die, weight in pmf_dice.Items():\n", " for outcome, prob in die.Items():\n", " mix.Incr(outcome, weight*prob)\n", "\n", " mix = thinkbayes.MakeMixture(pmf_dice)\n", "\n", " colors = thinkplot.Brewer.Colors()\n", " thinkplot.Hist(mix, width=0.9, color=colors[4])\n", " \n", " # thinkplot.Show() # image view\n", " \n", " thinkplot.Save(root='./images/dungeons3',\n", " xlabel='Outcome',\n", " ylabel='Probability',\n", " formats=FORMATS)\n", "\n", "\n", "if __name__ == '__main__':\n", " main()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### 그림 5-3 상자에서 임의의 주사위를 굴릴 때의 결과 확률 분포\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5.7 토의" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "- 베이지안 분석은 모두 분포에 대한 것이므로, 분포의 개념을 이해하기위해 이 장은 중요하다.\n", "- 컴퓨터 관점에서,**분포**는 **값과 해당 확률을 표현하는 데이터 구조**다." ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# python 문법 보충\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "https://docs.python.org/2/reference/datamodel.html#emulating-numeric-types \n", "\n", "https://wikidocs.net/89" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "my count = 2 입니다\n", "my count = 3 입니다\n" ] }, { "data": { "text/plain": [ "<__main__.Nemo instance at 0x0000000015B3F088>" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "class Nemo:\n", " def __init__(self):\n", " self.cnt =1\n", " \n", " def __add__(self, x):\n", " self.cnt += x.cnt\n", " print 'my count = ' + str(self.cnt) + ' 입니다'\n", " return self\n", " \n", "n1 = Nemo()\n", "n2 = Nemo()\n", "n3 = Nemo()\n", "\n", "# n1 + n2\n", "kk = n1 + n2 \n", "kk + n3" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }