Skip to content
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

matrix multiply 'by hand' #9

Closed
wants to merge 1 commit into from
Closed

matrix multiply 'by hand' #9

wants to merge 1 commit into from

Conversation

graysonwhite
Copy link
Contributor

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

@joshyam-k
Copy link
Collaborator

Closing this as I prepare to open a pull request with similar changes in a large overhaul!

@joshyam-k joshyam-k closed this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants