Skip to content

Commit

Permalink
Draft paper
Browse files Browse the repository at this point in the history
  • Loading branch information
smitdave committed Mar 15, 2024
1 parent 0a7de46 commit 6247111
Show file tree
Hide file tree
Showing 207 changed files with 2,618 additions and 1,875 deletions.
2 changes: 1 addition & 1 deletion .Rproj.user/BAB4038F/pcs/files-pane.pper
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ascending": true
}
],
"path": "~/git/pf.memory/R"
"path": "~/git/pf.memory/vignettes"
}
2 changes: 1 addition & 1 deletion .Rproj.user/BAB4038F/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab": 10
"activeTab": 3
}
4 changes: 2 additions & 2 deletions .Rproj.user/BAB4038F/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"left": {
"splitterpos": 457,
"splitterpos": 372,
"topwindowstate": "NORMAL",
"panelheight": 1172,
"windowheight": 1210
},
"right": {
"splitterpos": 614,
"splitterpos": 385,
"topwindowstate": "NORMAL",
"panelheight": 1172,
"windowheight": 1210
Expand Down
2 changes: 1 addition & 1 deletion .Rproj.user/BAB4038F/pcs/workbench-pane.pper
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"TabSet1": 1,
"TabSet2": 5,
"TabSet2": 0,
"TabZoom": {}
}
36 changes: 36 additions & 0 deletions .Rproj.user/BAB4038F/sources/prop/INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
~%2Fgit%2Fmozy_ecology.R="24C7EAB6"
~%2Fgit%2Fpf.memory%2FDESCRIPTION="6683BFBF"
~%2Fgit%2Fpf.memory%2FNAMESPACE="534057AC"
~%2Fgit%2Fpf.memory%2FR%2FFmu-base.R="5BAA819E"
~%2Fgit%2Fpf.memory%2FR%2FFmu-chronic.R="36BCD81E"
~%2Fgit%2Fpf.memory%2FR%2FFmu-immune.R="B31465E0"
~%2Fgit%2Fpf.memory%2FR%2FFmu-interface.R="D32BC313"
~%2Fgit%2Fpf.memory%2FR%2FMMinfinity.R="B7C5F496"
~%2Fgit%2Fpf.memory%2FR%2FOmega-beta.R="A060A2F0"
~%2Fgit%2Fpf.memory%2FR%2FOmega-interface.R="5D88E9B4"
~%2Fgit%2Fpf.memory%2FR%2FRBC.R="71153DE9"
~%2Fgit%2Fpf.memory%2FR%2FTheta.R="57BD1419"
~%2Fgit%2Fpf.memory%2FR%2Falpha2density-beta.R="7B0E571F"
~%2Fgit%2Fpf.memory%2FR%2Falpha2density.R="7BF3E52A"
~%2Fgit%2Fpf.memory%2FR%2Falpha2mu-W.R="0615E065"
Expand All @@ -17,13 +26,27 @@
~%2Fgit%2Fpf.memory%2FR%2FaoyN.R="6F2904AF"
~%2Fgit%2Fpf.memory%2FR%2Fbeta.R="FBD39C0C"
~%2Fgit%2Fpf.memory%2FR%2Fblood_volume.R="CFD4D0B3"
~%2Fgit%2Fpf.memory%2FR%2Fclonal_counts.R="2ABD17C1"
~%2Fgit%2Fpf.memory%2FR%2Fclonal_densities.Rmd="1A7B5D93"
~%2Fgit%2Fpf.memory%2FR%2Fclonal_density.R="91FB5CE3"
~%2Fgit%2Fpf.memory%2FR%2Fclonal_detection.R="7644269F"
~%2Fgit%2Fpf.memory%2FR%2Fclone_counts.R="4BB8024B"
~%2Fgit%2Fpf.memory%2FR%2Fclone_density.R="B7D443C0"
~%2Fgit%2Fpf.memory%2FR%2Fclone_detection.R="746DA46A"
~%2Fgit%2Fpf.memory%2FR%2Fcohort_counts.R="44AB2D5D"
~%2Fgit%2Fpf.memory%2FR%2Fcohort_detect.R="80E3C356"
~%2Fgit%2Fpf.memory%2FR%2Fcohort_parasites_clones.R="D759A9B3"
~%2Fgit%2Fpf.memory%2FR%2Fcohort_parasites_complex.R="42884925"
~%2Fgit%2Fpf.memory%2FR%2Fcohort_parasites_simple.R="6C8EA019"
~%2Fgit%2Fpf.memory%2FR%2Fconvolve.R="912073C6"
~%2Fgit%2Fpf.memory%2FR%2Fcount_parasites.R="4B4677E9"
~%2Fgit%2Fpf.memory%2FR%2Fcounts.R="6DB6CAA1"
~%2Fgit%2Fpf.memory%2FR%2Fcounts_clone.R="47B7018F"
~%2Fgit%2Fpf.memory%2FR%2Fcounts_parasites.R="1C0FAD32"
~%2Fgit%2Fpf.memory%2FR%2Fdensity_clone.R="81AE25DE"
~%2Fgit%2Fpf.memory%2FR%2Fdensity_parasites.R="51C0BF39"
~%2Fgit%2Fpf.memory%2FR%2Fdetect_clone.R="DE4F2A82"
~%2Fgit%2Fpf.memory%2FR%2Fdetect_parasites.R="BDBFDDB0"
~%2Fgit%2Fpf.memory%2FR%2Fdetection-interface.R="6B78DF9F"
~%2Fgit%2Fpf.memory%2FR%2Fdetection-nb.R="8A490595"
~%2Fgit%2Fpf.memory%2FR%2Fdetection-pois.R="EAFCEBC2"
Expand All @@ -38,30 +61,43 @@
~%2Fgit%2Fpf.memory%2FR%2Fhost_cohorts.R="84C0B865"
~%2Fgit%2Fpf.memory%2FR%2Fhybrid.R="0E8F467C"
~%2Fgit%2Fpf.memory%2FR%2Fimmune_tracking.R="A048ED65"
~%2Fgit%2Fpf.memory%2FR%2Finfection_dynamics.R="E4269552"
~%2Fgit%2Fpf.memory%2FR%2Fmodified_beta.R="60B42952"
~%2Fgit%2Fpf.memory%2FR%2Fmoi.R="C75BDA96"
~%2Fgit%2Fpf.memory%2FR%2Fmu2density-beta.R="3D56436C"
~%2Fgit%2Fpf.memory%2FR%2Fmu2density-interface.R="D21B11A3"
~%2Fgit%2Fpf.memory%2FR%2Fmu2density.R="72434DC4"
~%2Fgit%2Fpf.memory%2FR%2Fomega-interface.R="3EC86BE4"
~%2Fgit%2Fpf.memory%2FR%2Fpar_dens_complex.R="DB0E72E9"
~%2Fgit%2Fpf.memory%2FR%2Fpar_dens_simple.R="D0F27E38"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_cohorts.R="6EB5B99B"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_counts.R="D26138E7"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_dens_complex.R="328463D5"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_dens_simple.R="919ADC01"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_densities.R="2D02006A"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_densities_complex.R="A563775B"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_densities_simple.R="20F45A82"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_density.R="9D367F2B"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_detection.R="DC442C1E"
~%2Fgit%2Fpf.memory%2FR%2Fparasite_simple.R="09250A2A"
~%2Fgit%2Fpf.memory%2FR%2Fparasites_simple.R="DE5F9651"
~%2Fgit%2Fpf.memory%2FR%2Fpr.R="CB713F73"
~%2Fgit%2Fpf.memory%2FR%2Fpr.Rmd="1950C552"
~%2Fgit%2Fpf.memory%2FR%2Fprevalence.R="1B2C829C"
~%2Fgit%2Fpf.memory%2FR%2Frbc.R="55313469"
~%2Fgit%2Fpf.memory%2FR%2Fsample-interface.R="AED269A3"
~%2Fgit%2Fpf.memory%2FR%2Fsample-nb.R="74561104"
~%2Fgit%2Fpf.memory%2FR%2Fsample-pois.R="5D82C219"
~%2Fgit%2Fpf.memory%2FR%2Fsampling-interface.R="022079D8"
~%2Fgit%2Fpf.memory%2FR%2Fsampling-nb.R="E683D640"
~%2Fgit%2Fpf.memory%2FR%2Fsampling-pois.R="94A976BD"
~%2Fgit%2Fpf.memory%2FR%2Futils.R="016A8C62"
~%2Fgit%2Fpf.memory%2FREADME.Rmd="02662E0A"
~%2Fgit%2Fpf.memory%2FREADME.md="5CA253FF"
~%2Fgit%2Fpf.memory%2F_pkgdown.yml="33F34E18"
~%2Fgit%2Fpf.memory%2Fdocs%2Findex.html="6399C0D0"
~%2Fgit%2Fpf.memory%2Fdocs%2Freference%2Fout="B693E1D7"
~%2Fgit%2Fpf.memory%2Fman%2Fd_detect.Rd="4AA32B57"
~%2Fgit%2Fpf.memory%2Fman%2Fout="D565CA5D"
~%2Fgit%2Fpf.memory%2Fvignettes%2FAoI-Hybrid.Rmd="11869B4B"
~%2Fgit%2Fpf.memory%2Fvignettes%2FAoI.Rmd="35C9761C"
Expand Down
93 changes: 48 additions & 45 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
# Generated by roxygen2: do not edit by hand

S3method(Detect,nb)
S3method(Detect,pois)
S3method(Fmu,W)
S3method(Fmu,base)
S3method(Fmu,chronic)
S3method(Wda,delta)
S3method(Wda,none)
S3method(ageFoI,flat)
S3method(ageFoI,type2)
S3method(alpha2mu,W)
S3method(alpha2mu,base)
S3method(alpha2mu,chronic)
S3method(binnedCounts,nb)
S3method(binnedCounts,pois)
S3method(dCounts,nb)
S3method(dCounts,pois)
S3method(d_mu2density,beta)
S3method(d_Omega,beta)
S3method(d_counts,nb)
S3method(d_counts,pois)
S3method(d_detect,nb)
S3method(d_detect,pois)
S3method(log10RBC,static)
S3method(pCounts,nb)
S3method(pCounts,pois)
S3method(p_mu2density,beta)
S3method(q_mu2density,beta)
S3method(r_mu2density,beta)
S3method(p_Omega,beta)
S3method(p_counts,nb)
S3method(p_counts,pois)
S3method(q_Omega,beta)
S3method(r_Omega,beta)
S3method(seasonalFoI,exp)
S3method(seasonalFoI,flat)
S3method(seasonalFoI,sin)
S3method(sigma_mu,abc)
S3method(trendFoI,flat)
export(Bdensity)
export(Detect)
export(DetectBda)
export(DetectPM)
export(FQ)
export(Fmu)
export(FoI)
export(MoIDistPlot)
export(MoIPM)
export(Wda)
export(ageFoI)
export(alpha2mu)
export(binnedCounts)
export(cdfConvolve2)
export(cdfConvolve2a)
export(cdfConvolve2b)
Expand All @@ -44,66 +37,76 @@ export(dAoIda)
export(dAoY)
export(dAoYN)
export(dAoYda)
export(dCounts)
export(dCountsBa)
export(dCountsPa)
export(dDensityPaConvolve2)
export(dMoIda)
export(d_Bdensity)
export(d_Pdensity)
export(d_Omega)
export(d_alpha2density)
export(d_mu2density)
export(d_clone_counts)
export(d_clone_density)
export(d_counts)
export(d_detect)
export(d_detect_mesh)
export(d_moi_count)
export(d_nz_counts_log)
export(d_nz_counts_log_binned)
export(d_parasite_counts)
export(d_parasite_density)
export(d_parasite_detect)
export(d_parasite_detect_moi)
export(dbeta1)
export(dmda)
export(dpda)
export(log10RBC)
export(meanCountsBa)
export(meanCountsPa)
export(meanMoI)
export(mean_clone_counts)
export(mean_parasite_counts)
export(momentAoI)
export(momentAoY)
export(moment_Bdensity)
export(moment_Pdensity)
export(moments_clone_density)
export(moments_parasite_density)
export(nzPois)
export(pAoI)
export(pAoY)
export(pAoYN)
export(pAoY_long)
export(pCounts)
export(pCountsBa)
export(pCountsPa)
export(p_Bdensity)
export(p_Omega)
export(p_alpha2density)
export(p_mu2density)
export(p_clone_counts)
export(p_counts)
export(p_nz_counts_log)
export(p_nz_counts_log_binned)
export(p_parasite_counts)
export(p_parasite_density)
export(par_Fmu_W)
export(par_Fmu_base)
export(par_Fmu_chronic)
export(par_Omega_beta)
export(par_Wda_delta)
export(par_Wda_none)
export(par_expSeason)
export(par_flatAge)
export(par_flatSeason)
export(par_flatTrend)
export(par_lRBC_static)
export(par_mu2dens_beta)
export(par_nbCounts)
export(par_poisCounts)
export(par_nb)
export(par_pois)
export(par_sigma_abc)
export(par_sinSeason)
export(par_type2Age)
export(parasite_density)
export(pbeta1)
export(q_Omega)
export(q_alpha2density)
export(q_mu2density)
export(qbeta1)
export(rAoI)
export(rAoY)
export(rAoYN)
export(rRda)
export(r_Bdensity)
export(r_Omega)
export(r_alpha2density)
export(r_mu2density)
export(r_parasite_density)
export(rbeta1)
export(salpha2mu)
export(sFmu)
export(seasonalFoI)
export(sigma_mu)
export(solveMMinfty)
Expand All @@ -112,5 +115,5 @@ export(solve_dAoYda)
export(solve_dm)
export(solve_dpda)
export(trendFoI)
export(truePRa)
export(truePR)
export(zda)
6 changes: 3 additions & 3 deletions R/alpha2mu-base.R → R/Fmu-base.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#' Compute expected log10 parasite densities, `mu`, as a function of the age of infection `alpha`
#' @description Compute mean log10 parasites for a model with no immunity
#'
#' @inheritParams alpha2mu
#' @inheritParams Fmu
#'
#' @return mean log10 parasite densities
#' @export
#'
alpha2mu.base = function(alpha, W, par_Fmu){with(par_Fmu,{
Fmu.base = function(alpha, W, par_Fmu){with(par_Fmu,{
B = tildel + (tildeb-tildel)*exp(-(Sa*(alpha-peak)))
ix = which(alpha<peak)
if(length(ix>0)) B[ix] = tildel+(tildeb-tildel)*alpha[ix]/peak
Expand All @@ -16,7 +16,7 @@ alpha2mu.base = function(alpha, W, par_Fmu){with(par_Fmu,{
B
})}

#' Set up parameters for [alpha2mu.base]
#' Set up parameters for [Fmu.base]
#'
#' @param peak The age of infection (in days) when parasite densities peak
#' @param liver The age of infection (in days) when parasites emerge from the liver
Expand Down
6 changes: 3 additions & 3 deletions R/alpha2mu-chronic.R → R/Fmu-chronic.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#' Compute expected log10 parasite densities, `mu`, as a function of the age of infection `alpha`
#' @description Compute mean log10 parasites for a model with no immunity
#'
#' @inheritParams alpha2mu
#' @inheritParams Fmu
#'
#' @return mean log10 parasite densities
#' @export
#'
alpha2mu.chronic = function(alpha, W, par_Fmu){with(par_Fmu,{
Fmu.chronic = function(alpha, W, par_Fmu){with(par_Fmu,{
B = tildel + (tildeb-tildel)*exp(-(Sa*(alpha)))
})}

#' Set up parameters for [alpha2mu.chronic]
#' Set up parameters for [Fmu.chronic]
#'
#' @param tildeb The maximum expected log10 parasite densities
#' @param tildel The minimum expected log10 parasite densities
Expand Down
6 changes: 3 additions & 3 deletions R/alpha2mu-immune.R → R/Fmu-immune.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#' Compute expected log10 parasite densities, `mu`, as a function of the age of infection `alpha`
#' @description Compute mean log10 parasites for a model with no immunity
#'
#' @inheritParams alpha2mu
#' @inheritParams Fmu
#'
#' @return mean log10 parasite densities
#' @export
#'
alpha2mu.W = function(alpha, W, par_Fmu){with(par_Fmu,{
Fmu.W = function(alpha, W, par_Fmu){with(par_Fmu,{
B = tildel + (tildeb-tildel)*exp(-Sa*(alpha-peak)-Sw*W)
ix = which(alpha<=peak)
if(length(ix>0)) B[ix] = tildel+(tildeb-tildel)*exp(-Sw*W)*alpha[ix]/peak
Expand All @@ -16,7 +16,7 @@ alpha2mu.W = function(alpha, W, par_Fmu){with(par_Fmu,{
B
})}

#' Set up parameters for [alpha2mu.W]
#' Set up parameters for [Fmu.W]
#'
#' @param peak The age of infection (in days) when parasite densities peak
#' @param liver The age of infection (in days) when parasites emerge from the liver
Expand Down
8 changes: 4 additions & 4 deletions R/alpha2mu-interface.R → R/Fmu-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#' @return mean log10 parasite densities, a [numeric] vector of length(alpha)
#' @export
#'
alpha2mu = function(alpha, W, par_Fmu){
UseMethod("alpha2mu", par_Fmu)
Fmu = function(alpha, W, par_Fmu){
UseMethod("Fmu", par_Fmu)
}

#' Compute mean, expected parasite densities `mu` for multiple values of the age of infection `alpha`
Expand All @@ -20,8 +20,8 @@ alpha2mu = function(alpha, W, par_Fmu){
#' @return mean log10 parasite densities, a [numeric] vector of length(alpha)
#' @export
#'
salpha2mu = function(alpha, W, par_Fmu){
sapply(alpha, alpha2mu, W=W, par_Fmu=par_Fmu)
sFmu = function(alpha, W, par_Fmu){
sapply(alpha, Fmu, W=W, par_Fmu=par_Fmu)
}


Loading

0 comments on commit 6247111

Please sign in to comment.