Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR adds removes the need for
predict.merMod
and does the matrix multiplication for prediction by hand.Currently, my code is far from pretty, but from my initial testing this does give the same result as our initial
predict.merMod
approach, but with a significant speed increase.@joshyam-k, could you take a close look at this code and make any needed changes for merging this. I know, for one, the lines 76 and 95 need to be changed to not be hard coded to "COUNTYFIPS".
In summary,
lines 74 - 78 create the matrices needed for prediction in the Gaussian model
81 - 90 allow for prediction on new levels for the Gaussian model
91-92 create the initial y.hat from the Gaussian model
94-97 set up the matrices and do the prediction from the Binomial model
100-104 pass the product of y.hat and p.hat into the same form as before