Friday, October 31, 2008

How Many Electoral Votes will Obama Get?

Yesterday Chris Rump at BGSU gave an interesting presentation about simulating the 2008 Presidential Election. He was explaining the methodology used by Nate Silver in the fivethirtyeight.com site.

Here is a relatively simple Bayesian approach for estimating the number of electoral votes that Barack Obama will get in the election on Tuesday.

First, using the polling data on cnn.com, I collected the percentages for McCain and Obama in the latest poll in each state. The web site only gives the survey percentages and not the sample sizes. A typical sample size in an election size is 1000 -- I will assume that each sample size is 500. This is conversative and it allows for some changes in voting behavior in the weeks before Election Day.

Suppose 500 voters in Ohio are sampled and 47% are for McCain and 51% are for Obama -- this means that 235 and 255 voters were for the two candidates. Let p.M and p.O denote the proportion of the voting population in Ohio for the two candidates -- 1 - p.M - p.O denote the proportion of the population for someone else. Assuming a vague prior on (p.M, p.O, 1-p.M-p.O), the posterior distribution for the proportions is proportional to

p.M^ 235 p.O^255 (1-p.M - p.O)^10

which is a Dirichlet distribution. The probability that McCain wins the election is simply the posterior probability

P(p.M > p.O)

For each state, I can easily estimate this probability by simulation. One simulates 5000 draws from a Dirichlet distribution and computes the proportion of draws where p.M > p.O.

The following table summarizes my calculations. For each state, I give the percentage of voters for McCain and Obama in the latest poll and my computed probability that McCain wins the state based on this data.

State M.pct O.pct prob.M.wins EV
1 Alabama 58 36 1.000 9
2 Alaska 55 37 1.000 3
3 Arizona 53 46 0.946 10
4 Arkansas 53 41 0.997 6
5 California 33 56 0.000 55
6 Colorado 45 53 0.032 9
7 Connecticut 31 56 0.000 7
8 Delaware 38 56 0.000 3
9 D.C. 13 82 0.000 3
10 Florida 47 51 0.189 27
11 Georgia 52 47 0.869 15
12 Hawaii 32 63 0.000 4
13 Idaho 68 26 1.000 4
14 Illinois 35 59 0.000 21
15 Indiana 45 46 0.416 11
16 Iowa 42 52 0.009 7
17 Kansas 63 31 1.000 6
18 Kentucky 55 39 1.000 8
19 Louisiana 50 43 0.949 9
20 Maine 35 56 0.000 4
21 Maryland 39 54 0.000 10
22 Massachusetts 34 53 0.000 12
23 Michigan 36 58 0.000 17
24 Minnesota 38 57 0.000 10
25 Mississippi 46 33 1.000 6
26 Missouri 50 48 0.675 11
27 Montana 48 44 0.825 3
28 Nebraska 43 45 0.329 5
29 Nevada 45 52 0.058 5
30 New Hampshire 39 55 0.000 4
31 New Jersey 36 59 0.000 15
32 New Mexico 40 45 0.117 5
33 New York 31 62 0.000 31
34 North Carolina 46 52 0.088 15
35 North Dakota 43 45 0.318 3
36 Ohio 47 51 0.182 20
37 Oklahoma 61 34 1.000 7
38 Oregon 34 48 0.000 7
39 Pennsylvania 43 55 0.004 21
40 Rhode Island 31 45 0.000 4
41 South Carolina 59 37 1.000 8
42 South Dakota 48 41 0.951 3
43 Tennessee 55 39 1.000 11
44 Texas 57 38 1.000 34
45 Utah 55 32 1.000 5
46 Vermont 36 57 0.000 3
47 Virginia 44 53 0.022 13
48 Washington 34 55 0.000 11
49 West Virginia 53 44 0.978 5
50 Wisconsin 42 53 0.007 10
51 Wyoming 58 32 1.000 3

Once we have these win probabilities for all states, it is easy to simulate the election. Essentially one flips 51 biased coins where the probability that McCain wins are given by these win probabilities. Once you have simulated the state winners, one can accumulate the electoral votes for the two candidates. I'll focus on the electoral count for Obama since he is predicted to win the election.

I repeated this process for 5000 simulated elections. Here is a histogram of the Obama electoral count. Note that all of the counts exceed 300 indicating that the probability that Obama wins the election is 1.

45 comments:

John Z. said...

What is the mean there? It looks very close to the 365 electoral votes he actually received.

Bill Jefferys said...

Yes, I would also like to know what the posterior mean (and median) of this simulation turned out to be.

robenamunroe0513 said...

so nice..................................................

said...

小遊戲小瓢蟲情色小遊戲射情遊戲射精遊戲成人game1069交友網1069交友1069拓峰貼圖1069拓峰網貼圖區1069拓峰網小遊戲下載小遊戲下載網站小弟弟成人遊戲網性感辣妹小遊戲性感遊戲性感免費色情卡通a片免費色情文學免費色情live影片免費色情a片欣賞免費色情a片免費色倩影片免費色倩電影下載免費色倩電影免費色倩短片免費色卡通影片免費色情成人片免費色情成人電影免費色情成人影片免費色情電影383免費色情照片自拍貼圖站自拍貼圖自拍貼片自拍論壇自拍親密性愛自拍露點自拍露穴自拍電影網站自拍電影女優王國,免費a片自拍貼圖區自拍貼圖圖自拍貼圖影片自拍偷拍貼圖區自拍偷拍貼圖

紅包 said...

我的痛苦會停止,但求我的心能征服它。 ..................................................

九份 said...

pleasure to find such a good artical! please keep update!! ........................................

驚訝 said...

感謝是愛心的第一步........................................

茂一 said...

色情論壇080豆豆聊天室avroom080aa片直播尼克成人網正妹空姐寫真正妹走光正妹找樂子sexav999免費影片日本制服美女日本制服美少女寫真集日本制服學生妹日本刺青圖片日本動畫卡通日本動漫卡通h日本十大av女優日本免費AV線上看日本免費試看短片日本免費視訊帳號視訊 辣妹美女 視訊sex888movie影城免費a片go2av免費影片航海王h短片分享go2av免費看影片a圖打飛機專用網情色cu成人bt入口hi5 tv聊天交友sun city性愛俱樂部影音聊天sex520免費影片日本視訊美女視訊聊天台灣論壇女生遊戲台灣論壇女生免費影片下載區性愛方式教學性愛文學小說性愛技巧圖解性愛技巧大全性愛技巧寫真

陳志其 said...

沒有友情,人生何樂? ..................................................

婷妏 said...

great msg for me, thanks a lot dude˙﹏˙

NicolaSigel0508 said...

日本avdvd 小魔女免費影城 無碼avdvd無碼卡通情色 情色論壇甜心寶貝貼片區 Show-live視訊聊天室 情色免費A片 情色偷拍免費A片 一本道a片東京熱avdvd影片 色美眉台中援交aa片試看 aaa片試看 情人輔助品成人網站做愛自拍偷拍 免費試看av免費成人電影 dudusex免費aa片試看 臺灣情色網線上免費a長片 0204免費a片試看 a片免費試看 a片天堂台灣論壇成人a漫畫 免費視訊聊天ing 免費視訊美女 aaa影片下載城 卡通aa片免費看成人影片分享 視訊聊天評比 104免費成人情色文學小說 視訊聊天網視訊電話ggoo 視訊-愛情館 黑色豪門企業綜合娛樂論壇 8591論壇 avonline免費a片 xo7777 net 貓咪論壇 視訊做愛 0951影片下載avdvd mobile01論壇 免費視訊ggoo 成人論壇 視訊聊天-成人網 plus 論壇 交友網 bbs論壇 s383av730 香港論壇 月光論壇 一本道 a片 東京熱論壇區 080豆豆出租情人視訊 999成人性站 拓網成人視訊 純愛迷情成人綜合論壇 性感遊戲 辣妹自拍哈尼視訊 情色視訊 拓網交友情色視訊 520sex-情色視訊 拓網視訊交友 sexygirl色妹妹視訊 sex520貼片援交視訊聊天室

志源 said...

淫亂火辣美女本土av情色視訊聊天免費色情網站性經驗色情成人影片色情視訊聊天av圖av情色情趣娃娃成人電影院淫蕩18禁色情電話情色成人網辣妹自拍台灣av女優台灣情色春宮台灣色情成人網站0401影音g點成人vcd情色影片520sex性愛圖視訊妹調情視訊美女聊天美女性交台灣性樂園成人影像走光打砲裸女寫真美女裸照露奶激突論壇情色圖片做愛線上a片做愛視訊情色成人成人交友穿幫色情a片情色全裸入鏡台灣情色網

雅婷雅婷宛佳 said...

性關係情色vcdav寫真集台灣色情網台灣辣妹辣妹聊天室裸女寫真淫娃網免費視訊辣妹一夜情貼圖情色下載色情vcdav網女生奶頭情色影音色論壇成人影片交流性幻想女生自慰影片美女性交辣妹裸體色情美女情色交友自慰圖成人自拍貼圖上空秀黃色圖片情色性愛辣妹胸部一絲不掛成人網址成人18禁台灣性網一夜情人淫妹性愛招式脫衣辣妹視訊自拍成人色情網一夜情人聊天室情色貼圖
情色貼圖

許柏信 said...

辛苦了!祝你愈來愈好!........................................

Bob0104byWas0104ham said...

辛苦了!祝你愈來愈好!.............................................

可欣 said...

成人情色論壇 aa 片俱樂部視訊i68美女 視訊女郎成人 情色 aa片免費看影片色漫畫帝國 免費a網,免費視訊辣妹 免費av999 sex影片視訊分享區 免費視訊聊天 ex jp成人-免費聊天室 夜色網 avhigh 視訊交友av1688 閃亮天使520聊天室 bt名模論壇 性感辣妹,sex女優 免費影片直播網 免費無碼影片 g8mm 網 34c高雄視訊聊天 正妹影音mmshow 成人a片網 oec 喔伊細辣妹視訊交友 yam交友天堂 777視訊美女 666成人網 哈啦視訊聊天室 性愛姿勢,sogo 色論壇 新竹援交a片免費線上看 a片-癡電車漢 kk俱樂部thmt aa成人漫畫 18禁聊天 18禁成人網 免費影片觀賞 洪爺免費a影片線上直 jp激麻a電影 聊天室交友b shop 成人視訊mela ,g點,免費a片,免費18影片 聊天室環球辣妹聊天室 90691 免費 aa 片試看情色文學 線上 aa 片試看嘟嘟,免費線上a電影 成人交友qk176 辣妹聊天室 90691 AV 前線 avdvd ut聊天室找一夜女 girl5320 貼片et免費影片下載 美國免費 aa 片試看aio 倉井空免費影片 wc123美色女影城 jp成人網

HaroldM22 said...

成功的第一要素是珍惜自己 ............................................................

D415_evonN_Risinger0 said...

More haste, less speed............................................................................

AlysiaDraeger0417永瑞 said...

金銀愈加磨鍊,愈加光亮,人生愈加考驗,生命愈加光輝。 ............................................................

峻君 said...

健康的身體是事業成功的基礎。 ............................................................

saa said...

nice to know you, and glad to find such a good artical!.........................

韋富 said...

blog不錯唷~我會常常來看的~加油~!!

陳隆 said...

河水永遠是相同的,可是每一剎那又都是新的。......................................................................

江婷 said...

閒來無聊逛逛blog~~跟您打聲招呼~~.................................................................

凱文凱文 said...

成熟,就是有能力適應生活中的模糊。.................................................................

李志吉 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................

葉瑞 said...

教育的目的,不在應該思考什麼,而是教吾人怎樣思考............................................................

原秋原秋 said...

感謝不吝分享您的心得............................................................

趙筱婷terrifields汪華昕 said...

吾錯吾錯...我平時都好鐘意用呢d~而家學多好多~thx+0+......................................................

吳婷婷 said...

厚 !!!等了好久的更新~~一定要支持的啦(ΘωΘ)......................................................

江淑如 said...

天道酬勤,blog也是!相信你的用心會讓你更受歡迎的............................................................

黃威宇 said...

There is no key to happiness, only a ladder..................................................................

文郭ss華賴ss添卉顏俊s任 said...

閱讀您的BLOG文章,真是件快樂的事!!.................................................................

珮瑜 said...

教育無他,愛與榜樣而已............................................................

韓秀美 said...

友誼能增進快樂,減少痛苦............................................................

李蔡文山家榮 said...

A contented mind is a perpetual feast.............................................................

家唐銘 said...

人不能像動物一樣活著,而應該追求知識和美德............................................................

家唐銘 said...

弱者等待時機,強者製造時機~~gogogo............................................................

灏群 said...

變天了~~注意身體,別感冒囉!............................................................

文王廷 said...

只有尋常才幹,但具有不尋常恆心的人,一切皆可獲取................................................

8468 said...

人生像一杯茶,若一飲而盡,會提早見到杯底..................................................

淑芳 said...

要在憂患恥辱的環境裡,創造我們自力更生的新生活。..................................................

翊翊翊翊張瑜翊翊翊 said...

知識可以傳授,智慧卻不行。每個人必須成為他自己。..................................................

建枫 said...

時間就是塑造生命的材料。

said...

用行動來支持你~~~不留言不行!............................................................