ã½ã·ã£ã²ããã£ã¦ãã¦ãããã確çãªã©ã調ã¹ãã«ã¯ä½åããã試ãã°ãããããæ°ã«ãªã£ãã®ã§èª¿ã¹ã¦ã¿ã
ä¸å®ç¢ºç\(p\)ã§æåã\(1-p\)ã§å¤±æããã¨ããåç´ãªã¢ãã«ãä»®å®ãã
ã¤ã¾ããã確ç\(p\)ã§ã¢ã¤ãã ãããããããã¨ããã¨ãã«ã試è¡åæ°ã«å¯¾ããæååæ°ã®å²åã§æå確ç\(p\)ãæ¨å®ãã
ä½åãããããã°ç¢ºç\(p\)ã®æ¨å®çµæãã©ããããã°ãã¤ããã調ã¹ã
éå¶ã®éã®éè¡ã«ãã£ã¦ä¹
ãã¶ãã«ãã¬ã¤ããã¨ã¬ã¢ãåºããé£ç¶ã§ã¯å½ãããåºãªãã£ããã¨ããæä½ããããããããªããããããã®ã¯èããªã
äºé åå¸ã®ä¿¡é ¼åºéãæ±ããããã¦ã¿ã¦ããããWikipediaãã¿ãã¨ããã¨è¤éãããªã®ã§ãå®éã«ã·ãã¥ã¬ã¼ã·ã§ã³ãã¦å¤ã®ã°ãã¤ãã調ã¹ã¦ã¿ã(æ£è¦åå¸è¿ä¼¼ãã¦ãããããã ãã©
ãã¤ãªãªã³ãããã
ãã¤ãªãªã³ããããã¨ããåå¸ã®å¯è¦åã®æ¹æ³ãè¦ãããã®ã§ãã£ãããªã®ã§ä½¿ã£ã¦ã¿ã(ãããããããã¯ãã¦ãã
ãããªæãã®å³ã§ãã¤ãªãªã³(ï¼)ã¿ãããªå½¢ã«ãªã£ã¦ããå·¦å³ã®2ã¤ã®å¼§ã¯ããã¼ã¿ã®æ¨å®ããã確çåå¸ã®å½¢ã表ãã¦ãã
弧ã®ä¸ã®åè§å½¢ã¯ç®±ã²ãå³ã表ãã¦ãã(ç®±ã²ãå³ä»¥å¤ã«ããããããªå¯è¦åã使ããã
ç®±ã²ãå³
åå¸ã®å¯è¦åã ã¨ç®±ã²ãå³ã¯ããåºã¦ããæ¹æ³ã§ã以ä¸ã®ãããªå½¢ããã¦ãã
ç®±ã²ãå³ã¯ãã¼ã¿ã®åå¸ãå¯è¦åããããã®ãã®ã§ãä¸å¤®ã®ç®±ã®ä¸ä¸ãååä½ç¹(ãã¼ã¿ãé çªã«ä¸¦ã¹ãã¨ãã«ä¸ã¨ä¸ãã25%ã¾ã§ã®ãã¼ã¿ãå«ã¾ããä½ç½®)ã§ç®±ã®çãä¸ã®ç·ãä¸å¤®å¤(ãã¼ã¿ãé çªã«ä¸¦ã¹ãã¨ãã«çå´ããååã¾ã§ã®ãã¼ã¿ãå«ã¾ããä½ç½®)
ã¤ã¾ãç®±ã®ä¸ã«ã¯åå¸ã®50%ãå«ã¾ãã
ç®±ãã伸ã³ã¦ããç·(ã²ã)ã¯ãååä½ç¹ã®éã®ç¯å²ããã1.5ã®é åãç®±ã®ç«¯ããã¨ã£ãã¨ãã«ãã®ä¸ã«å«ã¾ãããã¼ã¿ã®ãã¡æãé ããã®ã¾ã§ã®ç·ã«ãªã£ã¦ãã(ã²ãã®æ¸ãæ¹ã¯ãããã種é¡ãããããã
ã²ãã®å¤å´ã®ç¹ã¯ä¸è¨ã®ç¯å²ã«å«ã¾ããªãã£ããã¼ã¿ã§ãå¤ãå¤çãªãã®ã表ãã¨ããã
ã²ãã®é¨åã«ã¯ç®±ã«å«ã¾ããªãã£ã50%ã®å¤§é¨åãå
¥ã£ã¦ããã¨èãããã(ãã¡ããåå¸ã®å½¢ã«ãã)
ä¸ã®ç®±ã²ãå³ã¯ãã¤ãªãªã³ããããã®æ¹ã¨åãããã«2ã¤å±±ãããåå¸ãå¯è¦åãã¦ããããç®±ã²ãå³ã ã¨ãã®æ å ±ã¯å¤±ããã¦ãã¾ã
çµæ
ã¨ããããã§ã·ãã¥ã¬ã¼ã·ã§ã³çµæã®åå¸ããã¤ãªãªã³ãããã(ä¸ã¯ç®±ã²ãå³)ã§ä½å³ãã¦ã¿ã
20, 100, 1000, 10000åã®ããããã®åæ°è©¦è¡ãã¦ç¢ºçãæ¨å®ããã®ã1ã»ããã¨ããååã«å¤§ããªã»ããæ°(ä»åã¯100000)ãã£ãã¨ãã®æ¨å®ããã確çã®åå¸ã調ã¹ã
å
·ä½çãªå®è£
ã¨ãã¦ã¯ã0ãã1ã®ä¹±æ°ãçæãã¦ä¸ãããã確çå¤ä»¥ä¸ã®ãã®ã®å²åã調ã¹ã
ã¡ãªã¿ã«ä¸çªå°ããªè©¦è¡åæ°ã10åã§ã¯ãªã20åãªã®ã¯ã試è¡åæ°ãå°ãªãããã¨ã°ã©ãã®å½¢ãæ®å¿µã«ãªããã¨ãå¤ãã£ãã®ã§å°ãå¢ããã¦ãã¾ã
\(p=0.02\)
ã¨ããããã§æå確çã0.02ã®ã¨ãã®ããããçµæãè¦ã¦ã¿ã(è¦ã¥ããã£ãã®ã§æ¨ªåãã«ãã¾ãã)
çãä¸ã®å¤ªãé»ãé¨åãç®±ã²ãå³ã®ç®±ã®é¨å(ä¸ä¸ã®ååä½ç¹ã®é)ã«å½ãã
ã¤ã¾ã試è¡åæ°ã20åã®æã«ã¯0.05ãã0ã®éã«50%以ä¸ã®ãã¼ã¿ãå«ã¾ãããã¨ã«ãªã
ãã®ç®±ã®é¨åã«æ³¨ç®ããã¨ã試è¡åæ°100åã§ããããªãã«å¹
ãããã1000åã«ãªãã¨æããã«çããªã£ã¦ããæãããã
確çãå¤ãã¦ããã¾ãå¾åã«å¤åã¯ãªãã®ã§ä»¥ä¸ã®å³ã®èª¬æã¯çç¥ãã
\(p=0.05\)
\(p=0.1\)
\(p=0.3\)
ã¾ã¨ã
2æ¡ã3æ¡ãããã®ãªã¼ãã¼ã®1人ã®äººéãã¡ãã£ã¨ããç¨åº¦ã®è©¦è¡åæ°ã ã¨çµæ§å¤§ããªå·®ãåºãã
ã¨ãããããã¤ãªãªã³ãããããè¦ã¦ãããããããªãã§ããorz
ã½ã¼ã¹ã³ã¼ã
ãã¤ãªãªã³ããããã«ã¯Seabornã使ãã¾ãã
import random import numpy as np import numpy.random as npr import seaborn as sns N = [20, 100, 1000, 10000] prob = [0.02, 0.05, 0.1, 0.3] M = 100000 for p in prob: temp = [] for n in N: result = [] for i in xrange(M): result.append(np.count_nonzero(npr.random(n) <= p) / float(n)) temp += result y = [] for n in N: y += [n] * M sns.violinplot(x=temp, y=y, bw=1, scale='width', cut=0, orient='h') sns.plt.title('p = ' + str(p)) sns.plt.ylabel('Number of Trials') sns.plt.xlabel('Distribution of Estimated Probability') sns.plt.show()