Giter VIP home page Giter VIP logo

Comments (4)

elliottmorris avatar elliottmorris commented on July 30, 2024

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.

tcbegley avatar tcbegley commented on July 30, 2024

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 than 1.
  • 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.

elliottmorris avatar elliottmorris commented on July 30, 2024

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.

tcbegley avatar tcbegley commented on July 30, 2024

Ok, thanks for responding, will take a look at the new version.

from us-potus-model.

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.