-
Notifications
You must be signed in to change notification settings - Fork 0
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
Exposed compartment jumps significantly in value #30
Comments
lievect <- getCountrySubregions.SpatVector("LIE", folder = "/tmp")
lierast <- getCountryPopulation.SpatRaster("LIE") |
On the eighth of March, the newExposed is calculated as the following
I believe the issue lies with the maximum value being over one, but it could be the values between these (because they're everywhere). |
The values of
The only explanation I can think of is line 1054 (as quoted) leads to the exposed being permitted much beyond where they should be, where the global sum is then inflated (because it's including exposure probabilities less than one) when it should only be a few. It's confusing because Thoughts, @ashokkrish? spatialEpisim.foundation/R/SVEIRD.BayesianDataAssimilation.R Lines 1053 to 1056 in 6dd5f47
|
Changing the previously quoted lines to the following results in a drastic change in the results. spatialEpisim.foundation/R/SVEIRD.BayesianDataAssimilation.R Lines 1053 to 1056 in 6dd5f47
newExposed <- terra::mask(if(simulationIsDeterministic) growth else stats::rpois(1, growth),
proportionSusceptible < 1,
maskvalues = TRUE,
updatevalue = 0) %>%
terra::mask(transmissionLikelihoods < 1,
maskvalues = TRUE,
updatevalue = 0)
|
@ashokkrish, I've identified that I made a small, understandable mistake when refactoring. I used the proportion susceptible ( I was going to ask you "What is the significance of sub-assigning zero wherever the "Wherever the likelihood of transmission from an infected person to a susceptible person is less than one, no exposure occurs, and wherever there are no susceptible people no new exposures can occur there." That's a drastic change in meaning, and given I've observed the results change for the better due to this and the meaning of the code has been made clearer, I'm going to push these changes once I verify that this issue and issue #24 have been fixed. if(deterministic) {
newExposed <- beta*pSusceptible*I_tilda
} else {
rpois(1, beta*pSusceptible*I_tilda)
}
newExposed[valSusceptible < 1] <- 0
newExposed[I_tilda < 1] <- 0 |
Have you had a chance to review this, or other issues, @ashokkrish ? |
The possible cause of #24 is this sudden jump in the exposed compartment; in the following table the jump occurs on the Eighth of March.
The text was updated successfully, but these errors were encountered: