Code Monkey home page Code Monkey logo

leo-senate-model's People

Contributors

dannguyen avatar joshkatz avatar keithw avatar m1arc00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leo-senate-model's Issues

Update poll data

Would be great to get a daily dump of the poll data. Otherwise it's hard to replicate the NYT's own math, follow along at home or explore alternate assumptions.

Large run-to-run variation in senate-likelihood.tsv

The senate-likelihood.tsv seems to end up with strange results and a huge run-to-run variation. In four successive runs of Rscript master-public.R, I got the below. It doesn't seem like this could be correctly reporting the probability estimate of a Democratic-controlled senate on those dates -- the variation between runs is too big (between 35% and 50% chance of retention?).

date dem
1-Jan-14 60
25-Feb-14 55
22-Apr-14 35

date dem
1-Jan-14 40
25-Feb-14 40
22-Apr-14 50

date dem
1-Jan-14 75
25-Feb-14 40
22-Apr-14 45

date dem
1-Jan-14 85
25-Feb-14 70
22-Apr-14 35

No such file: senate-likelihood.tsv

I'm imagining this is mainly an individualized problem, since I don't see any other error postings on here -- but if it's not, here's a screenshot of my output when the simulation starts:

image

Execution time question

Just as a reality check, how long does it take you to run this with n.sims <- 250000, and what kind of system are you running it on?

For us it's been running for about two hours on a 4.4 GHz Core i7-2600K, saturating one core, and the numbers counting down (after "SIMULATING THINGS") have gone from 307 down to 220. It's consuming about 9-12 GiB of RAM.

Do you run it on lots of EC2 nodes and have some technique to combine multiple separate runs (with a smaller n.sims in each run) or otherwise multithread it? At this rate, running on one core it looks like it will take more than a day to finish. :-)

Thanks,
Keith

Freeze random seed

It might be a good idea to fix the random seed used for the 250,000 realizations of the simulation, in case readers are interested in reproducing exactly the numbers reported on the NYT Upshot Web site.

I have tried with today's data and cannot quite match the figures on the Web site. For example, even after trying several times, I can't get up to >88.5% for New Hampshire. (The public figure is 89.)

But there is some run-to-run slop that comes from the randomness, and it would be easier to debug if I knew I was using the same random seed as the public figures.

Basic help

I was interested in using this code for a project, but as it stands, I'm stumped on how to get it up and running. When I run the basic code, this is the output I get. Does anyone have any suggestions?
issue

Including output in the repo

  1. Thanks for this
  2. Would it be worthwhile to just include the published output? Unless the code is going to be changing on a frequent continuous basis? At the least, a sample inventory can be posted (I'll submit a pull request in just a bit)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.