-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor the HSe functions #2
Comments
Just tested the whole procedure over 5000 iterations, it took 43 seconds with 100 herds in 2 risk categories. |
Whole process for 1000 herds, 5 risks categories for animals, 5 for herds. 100 iterations == 41 seconds. This is probably not a good enough start as the models will become much more complex.... Several years and several components. |
I had a discussion with @stewid about this problem. He suggested using |
Over 10000 iteractions the test in ´full_test.R` took:
Using the new code:
I will merge this into the master |
These functions could vectorized. Currently the functions calculate, the HSe for a single herd given the distribution of animal risk groups in the farm. It uses the product function to solve this. However, if we want to be able to pass a vector of herds then the function needs to either take wide data, currently it is long form, or internally reshape the data to wide and pass these vectors to the function.
The current use required indexing of the dataframe many times which is slow. This will be a problem when using the function to test scenarios with a distribution of input parameters.
The text was updated successfully, but these errors were encountered: