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

Add network model simulation #60

Merged
merged 50 commits into from
Feb 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4674431
add WIP .sim_network_bp function
joshwlambert Jan 12, 2024
c01e77e
fix sampling contacts and bookkeeping ancestors
joshwlambert Jan 15, 2024
69e99c9
fixed sampling contact distribution with replacement
joshwlambert Jan 16, 2024
8a1d3b5
increase size of allocated vectors
joshwlambert Jan 16, 2024
4907363
fixed issue counting chain length
joshwlambert Jan 16, 2024
6122f9b
simplified vector indexing in .sim_network_bp
joshwlambert Jan 16, 2024
36da388
simplified next_gen_size calculation in .sim_network_bp
joshwlambert Jan 16, 2024
aabab0e
remove preallocation of id vec and add vector growing to .sim_network_bp
joshwlambert Jan 16, 2024
5dc439c
remove input checking from .sim_network_bp as it is an internal function
joshwlambert Jan 16, 2024
a401eef
updated .check_sim_input with new model arguments
joshwlambert Jan 16, 2024
4f6fd61
updated .sim_contacts_tbl for new simulation model
joshwlambert Jan 16, 2024
ae79da1
updated exported simulation function to use new model arguments
joshwlambert Jan 16, 2024
049a6ec
updated .sim_bp_linelist to use .sim_network_bp
joshwlambert Jan 16, 2024
fa35b39
updated add_cols function to sample infected individuals
joshwlambert Jan 16, 2024
0b629ef
removed contact_distribution from functions that no longer use it
joshwlambert Jan 17, 2024
30e7bfb
removed documentation for old arguments and added documentation for n…
joshwlambert Jan 17, 2024
42b5496
added details to .sim_network_bp documentation
joshwlambert Jan 17, 2024
1f0d2c8
updated man files for updated functions
joshwlambert Jan 17, 2024
6de6d13
fix typo converting contact_interval to function in sim_contacts
joshwlambert Jan 17, 2024
02abe5f
fixed examples and inherit doc in .sim_network_bp
joshwlambert Jan 17, 2024
bdcbff7
added tests for .sim_network_bp
joshwlambert Jan 17, 2024
4b1ca9d
added linelist row filtering to sim_outbreak
joshwlambert Jan 17, 2024
8d09db7
reduced maximum iterations for simulation conditioning
joshwlambert Jan 17, 2024
8f6dd78
updated tests to pass with new arguments
joshwlambert Jan 17, 2024
735ec13
pass add_names argument to .sim_network_bp
joshwlambert Jan 18, 2024
c9f8bc5
update simulation functions to use new arguments in vignettes
joshwlambert Jan 18, 2024
dfae23d
remove mention of bpmodels from the package
joshwlambert Jan 18, 2024
2106172
Update CITATION.cff
actions-user Jan 18, 2024
e19b496
update README to use new simulation function arguments
joshwlambert Jan 18, 2024
9970476
Automatic readme update
actions-user Jan 18, 2024
0d2cf1d
update mean_contacts to contact_distribution
joshwlambert Jan 19, 2024
2156fcb
update tests to use contact_distribution instead of mean_contacts
joshwlambert Jan 19, 2024
3888aeb
update vignettes and README to use contact_distribution instead of me…
joshwlambert Jan 19, 2024
282057a
Automatic readme update
actions-user Jan 19, 2024
b428d1c
linting
joshwlambert Jan 19, 2024
bb141f8
increase excess degree distribution density upper bound
joshwlambert Jan 31, 2024
cd5fe64
update seed in .sim_network_bp test to pass
joshwlambert Jan 31, 2024
4315035
added .sample_names function
joshwlambert Feb 5, 2024
d767163
use .sample_names in .add_names function
joshwlambert Feb 5, 2024
69ff03f
removed warning and break for large line lists with names in .sim_net…
joshwlambert Feb 5, 2024
fb5e435
linting
joshwlambert Feb 5, 2024
e60bdf7
added network option to create_config
joshwlambert Feb 6, 2024
2985b39
updated create_config tests
joshwlambert Feb 6, 2024
173a855
add option to turn off network effect in .sim_network_bp and remove a…
joshwlambert Feb 6, 2024
be49848
added test for .sim_network_bp without network effect and update othe…
joshwlambert Feb 6, 2024
baeb283
removed add_names argument from .sim_network_bp call in sim_* functions
joshwlambert Feb 6, 2024
91f77ff
removed add_names argument from .sim_bp_linelist
joshwlambert Feb 6, 2024
5d83edc
updated sim_contacts and sim_linelist tests
joshwlambert Feb 6, 2024
297d713
added info box to simulist vignette on network effect in model
joshwlambert Feb 6, 2024
bdac6de
use snapshot tests for regression testing .sim_network_bp
joshwlambert Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplified next_gen_size calculation in .sim_network_bp
joshwlambert committed Jan 16, 2024
commit 36da3889576072f3b4ec842a02971bf037e6c210
2 changes: 1 addition & 1 deletion R/sim_network_bp.R
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@
}
ancestor_idx <- setdiff(which(infected == 1), prev_ancestors)
prev_ancestors <- c(prev_ancestors, ancestor_idx)
next_gen_size <- sum(infected[which(generation == max(generation))])
next_gen_size <- length(ancestor_idx)
} else {
next_gen_size <- 0L
}