Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes
dust
as a dependency and starts the exploration of a proper rng interface. There's quite a bit in here as a result. But the main thing that we're trying to do is to build a well-behaved stochastic model that can eventually unblock #68. I don't think that this has everything (you need grouped structure too, right @edknock?) but this gets us most of the way.The
monty_rng
interface is not suitable for creating models because we can't use the streams in the same way as we do from dust. If we haven
values insize
andprob
andn
streams inrng_state
I want to be able to doBinomial(size, prob, rng_state)
and have the first stream use the first size and prob, the second stream use the second etc. This is not implemented inmonty_rng
and this means we have no way to draw random numbers in a way that we can build models that look like dust but without using it.Here I've sketched out a couple of accessor functions (see the
2
files in bothR/
andsrc/
); these allow access in this way. Then we build a particle filter by hand (this is tedious and was done following the manual implementation in the dust2 helpers: https://github.com/mrc-ide/dust2/blob/main/tests/testthat/helper-dust.R#L5). With that I have managed to replace all the dust code and replaced it with this model.The next step will be to make this work with multiple parameter sets, which I'll do in the next PR.
Merge after #84, contains those commits