Comments (4)
If you have some faster code we would love to use it! Paste it here or fork, whatever works.
On the specifics of the function, we just used those defaults to get the function working. The inverse logit transformation shouldn't matter. But if we're introducing bugs do let us know.
from us-potus-model.
Hey @elliottmorris
Thanks for responding. My question wasn't so much about the speed of the code, rather the logic.
My current understanding is that the prior for state by state democratic support is specified as the inverse logit of a multivariate normal. The covariance matrix of the normal distribution is assumed to have a correlation of 0.9
(this line) and we want to choose the right variance on the logit scale so that our prior has the desired variance on the probability scale. Which is what find_sigma2_value
is for. (If that's wrong then skip the rest of the question 😅)
Estimating the right variance you seem to be doing with a monte carlo estimate, drawing normal samples on the logit scale for some fixed variance, computing the resulting variance / standard deviation on the probability scale, then optimising the observed error with respect to the variance. The things I didn't understand were:
- When drawing the normal samples, shouldn't the correlation match the correlation we will ultimately use? I.e.
0.9
rather than1
. - Should normal samples be centered at the origin? The transformed samples (after inverse logit) will have a mean of 0.5 in that case, but I can't otherwise see why you would draw samples with mean 0.5
- What's the significance of 10? I think you have 9 state variables, and maybe originally it was 10 in an earlier model? Is that all it is?
- Why not calculate standard deviation from the transformed samples, rather than calculating the standard deviation on the samples then transforming it?
I guess some of these could be considered "bugs" if my understanding is correct, but I am reluctant to submit any patches / changes when I don't actually know for sure that I've understood what's going on. Oh and let me know if there's a more appropriate venue for these sorts of questions.
from us-potus-model.
I think some of this could have been bad practice but ultimately the program was providing stable estimates. Anyway it doesn't matter as the function has been removed from the latest code. Thanks for flagging.
from us-potus-model.
Ok, thanks for responding, will take a look at the new version.
from us-potus-model.
Related Issues (20)
- Release CSV with results of simulations HOT 1
- CSV extract of polls has malformed dates HOT 1
- Unable to locate file HOT 1
- 2008 polls HOT 1
- What is the goal?
- Hello world
- Unused parameter in stan model HOT 1
- Add estimates and data from Senate and House models? HOT 1
- Extra levels in factor for population variable HOT 1
- The website appears to calculate senate ties incorrectly - and therefore also the total win probability HOT 4
- stringsAsFactors = TRUE prevents use of state polling data by stan models fit to 2008, 2012, and 2016 HOT 1
- Hi HOT 1
- Delegate Confidence Interval conflicts with estimated probability of win.
- Daily model output
- Sorting by state in Key States bad alphebetization
- Error running 2008_model.R
- Backtesting Results HOT 2
- How to run this? HOT 2
- Possible typo in `final_2016.R`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from us-potus-model.