Closed dylanhmorris closed 2 months ago
My inclination would be both/and: init PRNG seed is default NULL
, so that this works:
wwinference(<args>, generate_initial_values = TRUE, initial_values_seed = 2)
But so does this:
withr::with_seed(5, {
wwinference(<args>, generate_initial_values = TRUE, initial_values_seed = NULL
})
Open to counterarguments / alternative suggestions.
I think this is reasonable to me! I can go head and implement this. My prference will be for this syntax in the vignette:
wwinference(<args>, generate_initial_values = TRUE, initial_values_seed = seed)
where we set the seed at the top of the vignette
@dylanhmorris this is dependent on changes in #58, so will likely wait for that to be merged unless I should just branch off of it. This is where I never know whats best to do with cascading issues/PRs
https://github.com/CDCgov/ww-inference-model/blob/410857b4634d31df7585060082d9c2dc539b7bbf/R/wwinference.R#L121-L126
We should either build in functionality for optional seed setting as an argument to
wwinference
or explicitly direct the user to runwwinference
in the context of an explicitly seeded PRNG if they want reproducible results.@kaitejohnson @seabbs