====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
gibson:teaching:fall-2012:math445:lab8 [2012/11/06 05:52] gibson [Math 445 Lab 8: Presidential election] |
gibson:teaching:fall-2012:math445:lab8 [2012/11/06 06:24] (current) gibson [Math 445 Lab 8: Presidential election] |
||
---|---|---|---|
Line 24: | Line 24: | ||
wins red and the bins corresponding to Obama wins blue, or else just draw a vertical | wins red and the bins corresponding to Obama wins blue, or else just draw a vertical | ||
line at the magic number of 270 electoral votes needed to win the election outright. | line at the magic number of 270 electoral votes needed to win the election outright. | ||
+ | |||
+ | ===== Questions ===== | ||
Then answer the following questions | Then answer the following questions | ||
Line 34: | Line 36: | ||
Turn in print-outs of your codes, your histogram, and your answers to the above questions. | Turn in print-outs of your codes, your histogram, and your answers to the above questions. | ||
- | Tips: | + | |
+ | ===== Tips ===== | ||
* Start with a small number of simulated elections (say 100) and then increase to a large number (say 10,000) when you're confident your code is working correctly. | * Start with a small number of simulated elections (say 100) and then increase to a large number (say 10,000) when you're confident your code is working correctly. | ||
Line 41: | Line 45: | ||
* Changing the colors of histogram bins in Matlab is not as easy as one might hope. You'll need to take data returned from the **hist** function and replot it with the **bar** command. See http://www.mathworks.com/matlabcentral/newsreader/view_thread/290534 for an example of how to do this. | * Changing the colors of histogram bins in Matlab is not as easy as one might hope. You'll need to take data returned from the **hist** function and replot it with the **bar** command. See http://www.mathworks.com/matlabcentral/newsreader/view_thread/290534 for an example of how to do this. | ||
+ | ===== Broader questions ===== | ||
Some further questions you might also address | Some further questions you might also address | ||
Line 54: | Line 58: | ||
Relevant matlab commands; **rand**, **randn**, **sum**, **hist**, and **bar**, plus standard plotting commands such as **xlabel**, **ylabel**, **title**. | Relevant matlab commands; **rand**, **randn**, **sum**, **hist**, and **bar**, plus standard plotting commands such as **xlabel**, **ylabel**, **title**. | ||
+ | |||
+ | ===== Background ===== | ||
Nate Silver, a sports statistician, pioneered the use of Monte Carlo methods | Nate Silver, a sports statistician, pioneered the use of Monte Carlo methods | ||
- | in election prediction during the 2008 elections ([[http://fivethirtyeight.blogs.nytimes.com/]], [[http://en.wikipedia.org/wiki/FiveThirtyEight]]). In the 2008 elections, His model predicted 49 of 50 states correctly for the Presidential race (missing Indiana, which went to Obama by 1%) and all 35 Senate races correctly. Note that this lab does not cover the subtlest and most difficult aspect of election prediction: producing good composite poll numbers and margins of error from large numbers of pollsters using different methods, sample sizes, and polling dates. There is quite a bit of controversy in the current election over Mr. Silver's methods and his assessment that Obama has an 91% chance of winning the election. See, for example, [[http://cosmiclog.nbcnews.com/_news/2012/10/30/14809227-political-forecasts-stir-up-a-storm?lite]], | + | in election prediction during the 2008 elections ([[http://fivethirtyeight.blogs.nytimes.com/]], [[http://en.wikipedia.org/wiki/FiveThirtyEight]]). In the 2008 elections, His model predicted 49 of 50 states correctly for the Presidential race (missing Indiana, which went to Obama by 1%) and all 35 Senate races correctly. Note that this lab does not cover the subtlest and most difficult aspect of election prediction: producing good composite poll numbers and margins of error from large numbers of pollsters using different methods, sample sizes, and polling dates. There is quite a bit of controversy in the current election over Mr. Silver's methods and his assessment that Obama has an 91% chance of winning the election. See, for example, |
- | [[http://www.dailykos.com/story/2012/11/01/1153661/-Nate-Silver-s-Math-Based-Math]], or google "Nate Silver controversy". | + | |
+ | * [[http://cosmiclog.nbcnews.com/_news/2012/10/30/14809227-political-forecasts-stir-up-a-storm?lite]], | ||
+ | * [[http://www.dailykos.com/story/2012/11/01/1153661/-Nate-Silver-s-Math-Based-Math]] | ||
+ | * [[http://2012.talkingpointsmemo.com/2012/11/nate-silver-colbert-report-pundits.php?ref=fpnewsfeed|Nate Silver on Colbert the Colbert Report]] | ||
+ | * google:"Nate Silver controversy"| | ||
+ | ===== Data ===== | ||
Here's some current polling data, taken from [[http://fivethirtyeight.blogs.nytimes.com]] on 2012-11-01. You can load this into Matlab as a matrix ''P'' by cutting and pasting the data into a text file ''P.asc'' and running ''load P.asc'' within Matlab. If you don't believe this polling data, feel free to use something you trust more. | Here's some current polling data, taken from [[http://fivethirtyeight.blogs.nytimes.com]] on 2012-11-01. You can load this into Matlab as a matrix ''P'' by cutting and pasting the data into a text file ''P.asc'' and running ''load P.asc'' within Matlab. If you don't believe this polling data, feel free to use something you trust more. |