Giter VIP home page Giter VIP logo

Comments (14)

adamboche avatar adamboche commented on July 29, 2024

@JeffreyBLewis How is this field calculated?

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

The formula is:

pr_i(Vote = Yea) = \Phi(u_ijyt - u_ijnt)

where u_ijyt and u_ijnt are the deterministic portion of the utility to legislator i to vote yea or nay (respectively) on rollcall j in congress t, and \Phi is the standard normal CDF. Furthermore,

u_ijyt = \beta exp(-1/2 (d^2_ij1yt + w^2 d^2_ij2yt))

where w is the dimension weight (1 for the first dim and ~0.4 for the second dim), \beta is the estimated \beta parameter, and d_ijkyt is the squared distance between legislator i's position on dimension k in congress t and the yea outcome point on rollcall j on dimension k in congress t (e.g. (X_ikt - O_jkyt)^2).

I will implement this in python and we can figure out where to put it, Adam. Jeff, please confirm this equation.

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

I've implemented this in /usr/scripts/rollcallEdits/voteProb.py and I saw the equations in Jeff's pynominate.py code as well so I'm pretty certain it is working correctly. The correlation between prob yea and actual yea votes is very strong for votes with clear cutlines and weak for rollcalls that look less predictable.

@adamboche, we need to figure out where this goes in the process. Currently I don't ingest, just compute the probabilities and print them/get correlations with actual votes.

from webvoteview.

aaronrudkin avatar aaronrudkin commented on July 29, 2024

If you guys could ingest into the old schema before we do the schema switchover, that'd be great. At least for a few votes so I can make sure the display code is working well and looks OK. Maybe all votes from the 114th? Also I am expecting 0-100 probabilities rather than 0-1. Let me know if you'd rather change it.

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

Ok, so I have produced these probabilities for the 114th in the old voteview database (and thus in the old schema) which are good for testing purposes.

We can easily switch this over to the new schema by uncommenting and deleting some lines in /usr/scripts/rollcallEdits/voteProb.py. Then the code can be run to populate the whole db in the new schema. However, because this is quite slow, it should probably be merged with Adam's populating of the icpsr and cast_codes in votes for each rollcall.

Nonetheless, this issue should be consider closed and when the schema are switched (Issue #22 ) we should resolve this problem.

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

@JeffreyBLewis, if a member votes "absent" they shouldn't get a vote probability, correct?

I've also been experimenting with unanimous and near-unanimous votes. Almost all produced vote probabilities are >99.9. I'll keep exploring this somewhat.

from webvoteview.

JeffreyBLewis avatar JeffreyBLewis commented on July 29, 2024

We don't have a model of abstention, so I don't have a probability of not voting. It might interesting to add information on the hypothetical probability of a yea vote for abstentions which we could show as greyed out in the table. What do you think?

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

I think it is a fair idea. One worry is that it may be too much information when people try to parse that column. They see numbers that mean probability of the vote the member actually made, which users then have to scan two columns to the left to see as well as numbers that are greyed out which mean hypothetical yea vote probabilities.

I'll implement it and see what it looks like.

from webvoteview.

aaronrudkin avatar aaronrudkin commented on July 29, 2024

It's mostly a UI problem, right? We could tool-tip or asterisk the hypothetical yea probabilities for abstentions.

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

I've implemented this for the person pages: http://128.97.229.160/person/21199

I think it looks fine but Aaron the tooltip might need a little work. I'm trying to think about how to deal with this with the sorting on the vote page. Because we are sorting least likely to most likely, how should we treat the abstainers? My thinking is that they should be thrown at the end as a new section and sorted from most to least likely to vote yea.

from webvoteview.

aaronrudkin avatar aaronrudkin commented on July 29, 2024

The tooltip sucks (not your fault, bootstrap's tooltip code is pretty bad--I will poke at this), but the column style is OK I think! :)

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

This is done for the vote table on the vote page now.

The title for the absent voters might need some work, but feel free to edit that if something better comes to mind.

Next I will work on vote probabilities when they are undefined so that we are robust to that problem. This is somewhat low priority as we should have probabilities for all vote rollcalls (as I'm working on producing those for rollcalls that don't have parameters). Otherwise I would close this issue.

from webvoteview.

aaronrudkin avatar aaronrudkin commented on July 29, 2024

I fixed the tooltip up so it looks clearer. @lukesonnet Are there any outstanding issues here?

from webvoteview.

lukesonnet avatar lukesonnet commented on July 29, 2024

No, I think it is fine. Tooltip is much better now. I was trying not to write a huge tooltip but I think it is worth it.

from webvoteview.

Related Issues (20)

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.