-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added filter_traj option to bpfilter
- Loading branch information
Showing
9 changed files
with
144 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
|
||
The unit tests here are designed to check for unintended consequences of code changes. The goal is to have 100% coverage and to raise a flag when computations are changed. | ||
|
||
1. Longer tests are needed to check whether the code provides numerically correct answers in situations where these are available. Some of those validations are carried out by Asfaw et al (2021). This code, and other examples, may be added later as package vignettes. | ||
1. Longer tests are needed to check whether the code provides numerically correct answers in situations where these are available. Some of those validations are carried out by Asfaw et al (2023). This code, and other examples, may be added later as package vignettes. | ||
|
||
2. For code-generated code (e.g., R code which writes C functions that are then compiled) covr checks whether the generating code was run, and it can test whether the generatd code has changed. However, it does not check whether the generated code was run. In the context of spatPomp, full testing necessitates running all the compiled code. | ||
|
||
3. Additional checks are carried out via a flag which defaults to extended=FALSE. | ||
3. Additional checks are carried out in the tests/xtests directory, and are not run by default. | ||
|
||
A call to igirf using the moment-based guide function can test compiled code for eunit_measure, munit_measure, vunit_measure, dunit_measure, runit_measure, rprocess, skeleton, rinit and partrans. | ||
|
||
22-08-06: covr ran on an intel Mac but threw a compiler error on an M1 Mac. Not sure yet if this is an architecture thing, or some other issue. | ||
22-08-06: covr ran on an intel Mac but threw a compiler error on an M1 Mac. This is apparently an architecture issue. | ||
|
||
References | ||
|
||
Asfaw, K., Park, J., Ho, A., King, A. A., and Ionides, E. L. (2021). Partially observed Markov processes with spatial structure via the R package spatPomp. (https://arxiv.org/abs/2101.01157) | ||
Asfaw, K., Park, J., King, A. A., and Ionides, E. L. (2023). Partially observed Markov processes with spatial structure via the R package spatPomp. (https://arxiv.org/abs/2101.01157) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
## This directory is for extra tests of correctness | ||
## requiring addition Monte Carlo intensity, which we do not | ||
## want to run every time we do the unit tests to check nothing has | ||
## been broken. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## extra tests of correctness requiring addition Monte Carlo intensity | ||
|
||
set.seed(42) | ||
library(spatPomp) | ||
|
||
|
||
print("Test he10 with towns_selected argument") | ||
h4 <- he10(U=4,towns_selected=c(1,2,11,12), | ||
basic_params = c( | ||
alpha =0.99, iota=0, R0=30, | ||
cohort=0.5, amplitude=0.3, gamma=52, | ||
sigma=52, mu=0.02, sigmaSE=0.05, | ||
rho=0.5, psi=0.1, g=800, | ||
S_0=0.036, E_0=0.00007, I_0=0.00006 | ||
)) | ||
s4 <- simulate(h4,seed=27) | ||
obs(s4)[,1:2] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters