From 0b6ea43bfc13aa040f6e5ed303ca0e603444cf22 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Thu, 26 Sep 2024 13:02:55 -0700 Subject: [PATCH 01/13] Increment version number to 1.2.0.9005 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 55a81d87..5a6cd957 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: serocalculator Type: Package Title: Estimating Infection Rates from Serological Data -Version: 1.2.0.9004 +Version: 1.2.0.9005 Authors@R: c( person(given = "Peter", family = "Teunis", email = "p.teunis@emory.edu", role = c("aut", "cph"), comment = "Author of the method and original code."), person(given = "Kristina", family = "Lai", email = "kwlai@ucdavis.edu", role = c("aut", "cre")), From eec8bf038561af3aae59a6f1fa283baae1071dce Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Thu, 26 Sep 2024 13:04:02 -0700 Subject: [PATCH 02/13] news and edits --- NEWS.md | 2 +- vignettes/articles/simulate_xsectionalData.Rmd | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index bf1fc512..c805ebb7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## New features -(to be added by future PRs) +* Updated `simulate_xsectionalData.Rmd()` (linting, removing deprecated functions). ## Developer-facing changes diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index 29273b0c..f57c2d58 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -60,12 +60,12 @@ knitr::opts_chunk$set( library(serocalculator) library(tidyverse) library(ggbeeswarm) # for plotting - +library(dplyr) # load in longitudinal parameters, these are modeled from all SEES cases across all ages and countries dmcmc <- "https://osf.io/download/rtw5k" %>% load_curve_params() %>% - filter(iter < 500) # reduce number of mcmc samples for speed + dplyr::filter(iter < 500) # reduce number of mcmc samples for speed ``` ## visualize antibody decay model @@ -173,7 +173,8 @@ ll_A <- log_likelihood( noise_params = cond, antigen_isos = "HlyE_IgA", lambda = 0.1 -) %>% print() +) %>% + print() ll_G <- log_likelihood( pop_data = csdata, @@ -181,15 +182,17 @@ ll_G <- log_likelihood( noise_params = cond, antigen_isos = "HlyE_IgG", lambda = 0.1 -) %>% print() +) %>% + print() -ll_AG <- llik( +ll_AG <- log_likelihood( pop_data = csdata, curve_params = dmcmc, noise_params = cond, antigen_isos = c("HlyE_IgG", "HlyE_IgA"), lambda = 0.1 -) %>% print() +) %>% + print() print(ll_A + ll_G) ``` From 3de7671d6561dc4335c30177f52e1e4199d63b2b Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 12:52:46 -0700 Subject: [PATCH 03/13] linting --- .../articles/simulate_xsectionalData.Rmd | 163 ++++++++++-------- 1 file changed, 87 insertions(+), 76 deletions(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index f57c2d58..6e03cc46 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -11,38 +11,38 @@ vignette: > %\VignetteIndexEntry{simulate_xsectionalData} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} ---- - - -This vignette shows how to simulate a cross-sectional sample of -seroresponses for incident infections as a Poisson process with frequency `lambda`. -Responses are generated for the antibodies given in the `antigen_isos` argument. - -Age range of the simulated cross-sectional record is `lifespan`. - -The size of the sample is `nrep`. - -Each individual is simulated separately, but different antibodies are -modelled jointly. - -Longitudinal parameters are calculated for an age: `age.fx` (fixed age). -However, when `age.fx` is set to NA then the age at infection is used. - -The boolean `renew.params` determines whether each infection uses a -new set of longitudinal parameters, sampled at random from the -posterior predictive output of the longitudinal model. If set to `FALSE` -a parameter set is chosen at birth and kept, but: -1. the baseline antibody levels (`y0`) are updated with the simulated level -(just) prior to infection, and -2. when `is.na(age.fx)` then the selected parameter sample is updated for the -age when infection occurs. - -There is also a variable `n.mc`: when `n.mc==0` then a random MC -sample is chosen out of the posterior set (1:4000). When `n.mc` is -given a value in 1:4000 then the chosen number is fixed and reused -in any subsequent infection. This is for diagnostic purposes. - - + --- + + + This vignette shows how to simulate a cross-sectional sample of + seroresponses for incident infections as a Poisson process with frequency `lambda`. + Responses are generated for the antibodies given in the `antigen_isos` argument. + + Age range of the simulated cross-sectional record is `lifespan`. + + The size of the sample is `nrep`. + + Each individual is simulated separately, but different antibodies are + modelled jointly. + + Longitudinal parameters are calculated for an age: `age.fx` (fixed age). + However, when `age.fx` is set to NA then the age at infection is used. + + The boolean `renew.params` determines whether each infection uses a + new set of longitudinal parameters, sampled at random from the + posterior predictive output of the longitudinal model. If set to `FALSE` + a parameter set is chosen at birth and kept, but: + 1. the baseline antibody levels (`y0`) are updated with the simulated level + (just) prior to infection, and + 2. when `is.na(age.fx)` then the selected parameter sample is updated for the + age when infection occurs. + + There is also a variable `n.mc`: when `n.mc==0` then a random MC + sample is chosen out of the posterior set (1:4000). When `n.mc` is + given a value in 1:4000 then the chosen number is fixed and reused + in any subsequent infection. This is for diagnostic purposes. + + ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, @@ -56,12 +56,15 @@ knitr::opts_chunk$set( ## load model parameters +Here we load in longitudinal parameters; +these are modeled from all SEES cases across all ages and countries: + ```{r setup} library(serocalculator) library(tidyverse) library(ggbeeswarm) # for plotting library(dplyr) -# load in longitudinal parameters, these are modeled from all SEES cases across all ages and countries + dmcmc <- "https://osf.io/download/rtw5k" %>% load_curve_params() %>% @@ -155,7 +158,12 @@ ggplot(csdata, aes( x = as.factor(antigen_iso), y = value )) + - geom_beeswarm(size = .2, alpha = .3, aes(color = antigen_iso), show.legend = F) + + geom_beeswarm( + size = .2, + alpha = .3, + aes(color = antigen_iso), + show.legend = FALSE + ) + geom_boxplot(outlier.colour = NA, fill = NA) + scale_y_log10() + theme_linedraw() + @@ -167,31 +175,34 @@ ggplot(csdata, aes( We can calculate the log-likelihood of the data as a function of the incidence rate directly: ```{r} -ll_A <- log_likelihood( - pop_data = csdata, - curve_params = dmcmc, - noise_params = cond, - antigen_isos = "HlyE_IgA", - lambda = 0.1 -) %>% +ll_A <- + log_likelihood( + pop_data = csdata, + curve_params = dmcmc, + noise_params = cond, + antigen_isos = "HlyE_IgA", + lambda = 0.1 + ) %>% print() -ll_G <- log_likelihood( - pop_data = csdata, - curve_params = dmcmc, - noise_params = cond, - antigen_isos = "HlyE_IgG", - lambda = 0.1 -) %>% +ll_G <- + log_likelihood( + pop_data = csdata, + curve_params = dmcmc, + noise_params = cond, + antigen_isos = "HlyE_IgG", + lambda = 0.1 + ) %>% print() -ll_AG <- log_likelihood( - pop_data = csdata, - curve_params = dmcmc, - noise_params = cond, - antigen_isos = c("HlyE_IgG", "HlyE_IgA"), - lambda = 0.1 -) %>% +ll_AG <- + log_likelihood( + pop_data = csdata, + curve_params = dmcmc, + noise_params = cond, + antigen_isos = c("HlyE_IgG", "HlyE_IgA"), + lambda = 0.1 + ) %>% print() print(ll_A + ll_G) @@ -202,13 +213,14 @@ print(ll_A + ll_G) We can also graph the log-likelihoods, even without finding the MLEs, using `graph.loglik()`: ```{r} -lik_HlyE_IgA <- graph.loglik( - pop_data = csdata, - curve_params = dmcmc, - noise_params = cond, - antigen_isos = "HlyE_IgA", - log_x = TRUE -) +lik_HlyE_IgA <- + graph.loglik( + pop_data = csdata, + curve_params = dmcmc, + noise_params = cond, + antigen_isos = "HlyE_IgA", + log_x = TRUE + ) lik_HlyE_IgG <- graph.loglik( previous_plot = lik_HlyE_IgA, @@ -241,9 +253,10 @@ est1 <- est.incidence( curve_params = dmcmc, noise_params = cond, lambda_start = .1, - build_graph = T, - verbose = T, # print updates as the function runs - print_graph = F, # display the log-likelihood curve while `est.incidence()` is running + build_graph = TRUE, + verbose = TRUE, # print updates as the function runs + print_graph = FALSE, # display the log-likelihood curve while + #`est.incidence()` is running antigen_isos = antibodies ) ``` @@ -271,7 +284,6 @@ autoplot(est1, log_x = TRUE) ```{r "init-parallel"} library(parallel) n_cores <- max(1, parallel::detectCores() - 1) -# n_cores = 1 print(n_cores) ``` @@ -284,13 +296,12 @@ nclus <- 10 nrep <- 100 # incidence rate in e -lmbdaVec <- c(.05, .1, .15, .2) +lambdas <- c(.05, .1, .15, .2) -sim.df <- +sim_df <- sim.cs.multi( - # verbose = TRUE, n_cores = n_cores, - lambdas = lmbdaVec, + lambdas = lambdas, nclus = nclus, n.smpl = nrep, age.rng = lifespan, @@ -302,16 +313,17 @@ sim.df <- format = "long" ) -print(sim.df) +print(sim_df) ``` We can plot the distributions of the simulated responses: ```{r} -ggplot(sim.df, aes( - x = as.factor(cluster), - y = value -)) + +sim_df %>% ggplot() + + aes( + x = as.factor(cluster), + y = value + ) + geom_beeswarm(size = .2, alpha = .3, aes(color = antigen_iso)) + geom_boxplot(outlier.colour = NA, fill = NA) + scale_y_log10() + @@ -335,7 +347,6 @@ ests <- verbose = TRUE, build_graph = TRUE, # slows down the function substantially antigen_isos = c("HlyE_IgG", "HlyE_IgA") - # antigen_isos = "HlyE_IgA" ) ``` From 3ac3b53410a7093b2d1ba6331dffd2578ae9fc2b Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 14:10:39 -0700 Subject: [PATCH 04/13] Increment version number to 1.2.0.9013 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4707fb39..664388da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: serocalculator Title: Estimating Infection Rates from Serological Data -Version: 1.2.0.9012 +Version: 1.2.0.9013 Authors@R: c( person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"), comment = "Author of the method and original code."), From 8777333d7d86ba507fbd6fe9f130801839972d36 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 14:12:02 -0700 Subject: [PATCH 05/13] wordlist --- .Rbuildignore | 2 +- inst/WORDLIST | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 6454e1b0..cb72ce2b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -26,6 +26,6 @@ allpopsamples_hlye.csv$ ^_quarto\.yml$ ^\.lintr$ ^vignettes$ -^man/df_to_array\.Rd$ ^vignettes/\.quarto$ ^vignettes/methodology\.qmd$ +^man/df_to_array\.Rd$ diff --git a/inst/WORDLIST b/inst/WORDLIST index 166b5b42..f03a07b0 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -5,7 +5,6 @@ BMC Bonačić Bordetella CMD -CODE’ Campylobacter Ceper Chiang @@ -85,6 +84,9 @@ Valk Vectorized Vellore Versteegh +VignetteEncoding +VignetteEngine +VignetteIndexEntry Volterra Wetering Wiens @@ -95,6 +97,7 @@ behaviour bioassays biomarker boldsymbol +bookdown callout campylobacteriosis cdot @@ -122,6 +125,7 @@ isotypes jinf jitter kDa +knitr le leq llik @@ -151,6 +155,7 @@ qquad recombinant renewcommand rescale +rmarkdown savePath sectionally sera @@ -173,9 +178,11 @@ subfigures th tibble titers +toc tsutsugamushi undercount unstratified varepsilon vec vee +xsectionalData From 5ac99c751172fe93a7fe09b643c1d8ec3aef6552 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 14:23:57 -0700 Subject: [PATCH 06/13] comments --- R/sees_baseline_data.R | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/R/sees_baseline_data.R b/R/sees_baseline_data.R index 90f878da..472c0e6e 100644 --- a/R/sees_baseline_data.R +++ b/R/sees_baseline_data.R @@ -1,14 +1,14 @@ -#' #' @docType data -#' #' -#' #' @name sees_crossSectional_baseline_allCountries -#' #' -#' #' @title -#' #' Cross-sectional Typhoid data -#' #' -#' #' @description -#' #' A [tibble::tibble()] -#' #' -#' #' @usage -#' #' sees_crossSectional_baseline_allCountries -#' #' -#' NULL +# #' @docType data +# #' +# #' @name sees_crossSectional_baseline_allCountries +# #' +# #' @title +# #' Cross-sectional Typhoid data +# #' +# #' @description +# #' A [tibble::tibble()] +# #' +# #' @usage +# #' sees_crossSectional_baseline_allCountries +# #' +# NULL From 95e7da3469a0e8935c07cfaabe28e8adca900c68 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 14:38:12 -0700 Subject: [PATCH 07/13] remove notes? --- .Rbuildignore | 1 + DESCRIPTION | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index cb72ce2b..958b4f56 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -28,4 +28,5 @@ allpopsamples_hlye.csv$ ^vignettes$ ^vignettes/\.quarto$ ^vignettes/methodology\.qmd$ +^\.quarto$ ^man/df_to_array\.Rd$ diff --git a/DESCRIPTION b/DESCRIPTION index 664388da..4c44f31e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -69,5 +69,4 @@ Remotes: moodymudskipper/devtag Roxygen: list(markdown = TRUE, roclets = c("collate", "rd", "namespace", "devtag::dev_roclet")) RoxygenNote: 7.3.2 -VignetteBuilder: - quarto + From 0692b13230e612becb1850e90fbbc35920405ce0 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Tue, 1 Oct 2024 14:44:36 -0700 Subject: [PATCH 08/13] move data documentation file to avoid linting --- {R => data-raw}/sees_baseline_data.R | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {R => data-raw}/sees_baseline_data.R (100%) diff --git a/R/sees_baseline_data.R b/data-raw/sees_baseline_data.R similarity index 100% rename from R/sees_baseline_data.R rename to data-raw/sees_baseline_data.R From b676a2f30d7f5f46d65231d10c4e1c17d85951d0 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Wed, 2 Oct 2024 08:53:16 -0700 Subject: [PATCH 09/13] fix --- vignettes/articles/simulate_xsectionalData.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index 2c73a153..0698d8b7 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -213,7 +213,7 @@ We can also graph the log-likelihoods, even without finding the MLEs, using `gra ```{r} lik_HlyE_IgA <- - graph.loglik( + graph_loglik( pop_data = csdata, curve_params = dmcmc, noise_params = cond, From 9d0f4b6eb077488f5e885cb6e54c450ef70670be Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Wed, 2 Oct 2024 09:06:15 -0700 Subject: [PATCH 10/13] remove accidental comment --- vignettes/articles/simulate_xsectionalData.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index 0698d8b7..c7020e7e 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -334,7 +334,7 @@ sim_df %>% ggplot() + ```{r, "est-by-stratum"} ests <- - # sim.df %>% + sim.df %>% est.incidence.by( pop_data = sim.df, curve_params = dmcmc, From 3aeca8caaca6fb1141c7a0250d273d12717cb005 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Wed, 2 Oct 2024 09:07:01 -0700 Subject: [PATCH 11/13] finish switch to underscore --- vignettes/articles/simulate_xsectionalData.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index c7020e7e..4565985a 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -334,9 +334,9 @@ sim_df %>% ggplot() + ```{r, "est-by-stratum"} ests <- - sim.df %>% + sim_df %>% est.incidence.by( - pop_data = sim.df, + pop_data = sim_df, curve_params = dmcmc, noise_params = cond, num_cores = n_cores, From c02414bf21aa6d0e6dfd643838440409bf0aa450 Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Wed, 2 Oct 2024 09:09:41 -0700 Subject: [PATCH 12/13] remove unnecessary pipe --- vignettes/articles/simulate_xsectionalData.Rmd | 1 - 1 file changed, 1 deletion(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index 4565985a..93eba11e 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -334,7 +334,6 @@ sim_df %>% ggplot() + ```{r, "est-by-stratum"} ests <- - sim_df %>% est.incidence.by( pop_data = sim_df, curve_params = dmcmc, From da5ef07d05413f0edc280427ebe69ccc1a2c1dbf Mon Sep 17 00:00:00 2001 From: Douglas Ezra Morrison Date: Wed, 2 Oct 2024 09:31:04 -0700 Subject: [PATCH 13/13] removed extra spaces --- .../articles/simulate_xsectionalData.Rmd | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/vignettes/articles/simulate_xsectionalData.Rmd b/vignettes/articles/simulate_xsectionalData.Rmd index 93eba11e..3869428d 100644 --- a/vignettes/articles/simulate_xsectionalData.Rmd +++ b/vignettes/articles/simulate_xsectionalData.Rmd @@ -14,33 +14,38 @@ vignette: > --- - This vignette shows how to simulate a cross-sectional sample of - seroresponses for incident infections as a Poisson process with frequency `lambda`. - Responses are generated for the antibodies given in the `antigen_isos` argument. - - Age range of the simulated cross-sectional record is `lifespan`. - - The size of the sample is `nrep`. - - Each individual is simulated separately, but different antibodies are - modelled jointly. - - Longitudinal parameters are calculated for an age: `age.fx` (fixed age). - However, when `age.fx` is set to NA then the age at infection is used. - - The boolean `renew.params` determines whether each infection uses a - new set of longitudinal parameters, sampled at random from the - posterior predictive output of the longitudinal model. If set to `FALSE` - a parameter set is chosen at birth and kept, but: - 1. the baseline antibody levels (`y0`) are updated with the simulated level - (just) prior to infection, and - 2. when `is.na(age.fx)` then the selected parameter sample is updated for the - age when infection occurs. +This vignette shows how to simulate a cross-sectional sample of +seroresponses for incident infections as a Poisson process with +frequency `lambda`. +Responses are generated for the antibodies given in the `antigen_isos` +argument. + +Age range of the simulated cross-sectional record is `lifespan`. + +The size of the sample is `nrep`. + +Each individual is simulated separately, but different antibodies are +modelled jointly. + +Longitudinal parameters are calculated for an age: `age.fx` (fixed age). +However, when `age.fx` is set to NA then the age at infection is used. + +The boolean `renew.params` determines whether each infection uses a +new set of longitudinal parameters, sampled at random from the +posterior predictive output of the longitudinal model. +If set to `FALSE`, +a parameter set is chosen at birth and kept, but: + +1. the baseline antibody levels (`y0`) are updated with the simulated +level (just) prior to infection, and + +2. when `is.na(age.fx)` then the selected parameter sample is updated +for the age when infection occurs. - There is also a variable `n.mc`: when `n.mc==0` then a random MC - sample is chosen out of the posterior set (1:4000). When `n.mc` is - given a value in 1:4000 then the chosen number is fixed and reused - in any subsequent infection. This is for diagnostic purposes. +There is also a variable `n.mc`: when `n.mc==0` then a random MC +sample is chosen out of the posterior set (1:4000). When `n.mc` is +given a value in 1:4000 then the chosen number is fixed and reused +in any subsequent infection. This is for diagnostic purposes. ```{r, include = FALSE} @@ -72,7 +77,9 @@ dmcmc <- ## visualize antibody decay model -We can graph individual MCMC samples from the posterior distribution of model parameters using a `autoplot.curve_params()` method for the `autoplot()` function: +We can graph individual MCMC samples from the posterior distribution +of model parameters using a `autoplot.curve_params()` method for the +`autoplot()` function: ```{r} dmcmc %>% autoplot(n_curves = 50) @@ -174,7 +181,7 @@ ggplot(csdata, aes( We can calculate the log-likelihood of the data as a function of the incidence rate directly: ```{r} -ll_A <- +ll_a <- log_likelihood( pop_data = csdata, curve_params = dmcmc, @@ -184,7 +191,7 @@ ll_A <- ) %>% print() -ll_G <- +ll_g <- log_likelihood( pop_data = csdata, curve_params = dmcmc, @@ -194,7 +201,7 @@ ll_G <- ) %>% print() -ll_AG <- +ll_ag <- log_likelihood( pop_data = csdata, curve_params = dmcmc, @@ -204,7 +211,7 @@ ll_AG <- ) %>% print() -print(ll_A + ll_G) +print(ll_a + ll_g) ``` ## graph log-likelihood