From 9d53da37901ac984803fab566df964816b1043e6 Mon Sep 17 00:00:00 2001 From: David Smith Date: Sat, 20 Jan 2024 09:43:07 -0800 Subject: [PATCH] xde_setup_cohort bug fixes --- .README.md.swp | Bin 16384 -> 0 bytes R/adult-GeRM.R | 4 ++-- R/adult-RM.R | 5 ++++- R/compute_terms.R | 4 ++-- R/diffeqn.R | 4 ++-- R/plot-terms.R | 2 +- R/setup.R | 18 +++++++++++++----- _pkgdown.yml | 4 ++++ man/xDE_diffeqn_cohort.Rd | 2 +- man/xde_setup_cohort.Rd | 9 ++++++--- vignettes/human_hmoi.Rmd | 23 +++++++---------------- vignettes/human_sip.Rmd | 16 ++++++---------- vignettes/human_sis.Rmd | 18 ++++++------------ 13 files changed, 54 insertions(+), 55 deletions(-) delete mode 100644 .README.md.swp diff --git a/.README.md.swp b/.README.md.swp deleted file mode 100644 index ec69c3c980f90b17982581827742142f7b20d31d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeHN%a0sK9qteU5-0@m5*MWMT7sR`&STfcu{StovX6L3)-1bgTgXCoO?ORCvE5zc zuI?F+4}>F#a0nMTa|t(c<00`MaDWR3g1GVc3*ZKPU-e^V*K3ea5IOWJ<;_ml<5%DB z`#pPxy*q<_ajnzy@bhuc`|SFcgLfYP@rBzz^E?~tERa*hNB{08h-_PrW7XEN^gEI9 zWpwWJZ&e$1L!EWiqn+LE;ckCtf436{=PqbIY!GM=cn=YH-n+E9;Y|JF$_4SsPuzYF z_inao5NHr+5NHr+5NHr+5NHr+5NHs1zax-Mp7q{DIrICU<+wt&>+wt&>+wt&>+wt&>+wt&>+wt&>--CKtSTn``2;q zr&;jh{eM;ezw?6U{S@Oz7@x!V;m17hIgGcT_q-oqyoK>?j5jde{D|j$599R@dERRn z<~h&%!v{U@U5xKO>v`Y7xPkF9MhByf@mn+;euMFAj9+5Bh4FoiH!yNrg^ECXHpLO(Nvbz83}%~VO>ljC9M*vl7TRJDrA~zKT-nQJ-L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Sn%;uFXQ5Z%+tt3oO`TS`-7Q&ADutest_hMoI +xde_setup_cohort(F_eir, Xname="hMoI", HPop=Hpop, Xopts = Xo) ->test_hMoI ``` ```{r} diff --git a/vignettes/human_sip.Rmd b/vignettes/human_sip.Rmd index 2d4e111e..011f9f1e 100644 --- a/vignettes/human_sip.Rmd +++ b/vignettes/human_sip.Rmd @@ -91,9 +91,11 @@ params$nHosts = 1 params$eir = EIR params$EIR = list() -F_eir = function(t, pars){ - pars$EIR[[1]] = params$eir -} +fF_eir = function(EIR){ + EIR = as.vector(EIR) + return(function(t, bday=0, scale=1){EIR}) +} +F_eir = fF_eir(EIR) params = make_parameters_demography_null(pars = params, H=H) @@ -138,15 +140,9 @@ Xo = list(b=0.55, c=0.15, r=1/200, Hpop = c(100, 500, 250) ``` -To use `xde_setup_cohort` we must set up a function `F_eir` returns the value of EIR we computed above: ```{r} -fF_eir1 = function(EIR){return(function(t, pars){EIR})} -F_eir1 = fF_eir1(EIR) -``` - -```{r} -xde_setup_cohort(F_eir1, Xname="SIP", HPop=Hpop, Xopts = Xo) -> test_SIP +xde_setup_cohort(F_eir, Xname="SIP", HPop=Hpop, Xopts = Xo) -> test_SIP ``` ```{r} diff --git a/vignettes/human_sis.Rmd b/vignettes/human_sis.Rmd index f1323527..3b221341 100644 --- a/vignettes/human_sis.Rmd +++ b/vignettes/human_sis.Rmd @@ -102,10 +102,11 @@ params$nHosts = 1 params$eir = EIR params$EIR = list() -params$eir = as.vector(EIR) -F_eir = function(t, pars){ - pars$EIR[[1]] = pars$eir -} +fF_eir = function(EIR){ + EIR = as.vector(EIR) + return(function(t, bday=0, scale=1){EIR}) +} +F_eir = fF_eir(EIR) params = make_parameters_demography_null(pars = params, H=H) @@ -153,15 +154,8 @@ Hpop = c(100, 500, 250) ``` -To use `xde_setup_cohort` we must set up a function `F_eir` returns the value of EIR we computed above: - -```{r} -fF_eir1 = function(EIR){return(function(t, pars){EIR})} -F_eir1 = fF_eir1(EIR) -``` - ```{r} -xde_setup_cohort(F_eir1, Xname="SIS", HPop=Hpop, Xopts = Xo) -> test_SIS +xde_setup_cohort(F_eir, Xname="SIS", HPop=Hpop, Xopts = Xo) -> test_SIS ``` ```{r}