-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about state_correlation_error
variance estimation.
#10
Comments
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. |
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 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:
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. |
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. |
Ok, thanks for responding, will take a look at the new version. |
Hello again,
I'm a little confused about what's going on here in the
find_sigma2_value
function. Specifically this linewhy is the correlation set to 1 in
cov_matrix
? This results in the 10 columns ofy
being identical, and hence aggregations likeapply(y, MARGIN = 2, mean)
result in a constant vector, which seems to make the subsequent call tomean
redundant. (EDIT - actually while we're on the subject, what's the significance of the choice of 10 here?)I notice a few lines down when
state_correlation_error
is created a correlation of 0.9 is used, and similarly forstate_correlation_mu_b_walk
andstate_correlation_mu_b_T
. Is there a reason the variance is estimated using a different correlation than is used to create the covariance matrices themselves?A related question, why is the mean of
y
set to 0.5? Applyinginv.logit
to standard normal samples would result in transformed samples with mean 0.5, but on the logit scale does mean 0 make more sense? (I don't think I understand what's going on here properly yet, so I might be wrong, the question is basically just motivated by symmetry 🙂)The text was updated successfully, but these errors were encountered: