From 48f3cb4525a7ac914385fd58c474af9ad89416e0 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 21 May 2024 13:28:29 +0000 Subject: [PATCH] Automatic readme update --- README.md | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d6b618e4..ea260319 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,11 @@ with `summary()`. Running `summary()` on the output of Objects returned from `simulate_chains()` can be aggregated into a `` of cases per time or generation with the function -`aggregate()`. The aggregated results can also be passed on to `plot()` -with its own arguments to customize the resulting plots. +`aggregate()`. + +The simulated `` object can be plotted in various ways using +`plot()`. See the plotting section in `vignette("epichains")` for two +use cases. ### Simulation @@ -96,7 +99,7 @@ we simulate a transmission chain with $20$ index cases, a constant generation time of $3$, and a poisson offspring distribution with mean $1$. We are tracking the chain “size” statistic and will cap all chain sizes at $25$ cases. We will then look at the summary of the simulation, -and aggregate it into cases per generation, and plot it. +and aggregate it into cases per generation. ``` r set.seed(32) @@ -138,14 +141,26 @@ summary(sim_chains) ``` r # Aggregate the simulation into cases per generation -chains_agrgegated <- aggregate(sim_chains, by = "generation") - -# plot the aggregated results -plot(chains_agrgegated, type = "b") +chains_agregegated <- aggregate(sim_chains, by = "generation") + +# view the time series of cases per generation +chains_agregegated +#> generation cases +#> 1 1 20 +#> 2 2 26 +#> 3 3 36 +#> 4 4 43 +#> 5 5 31 +#> 6 6 25 +#> 7 7 20 +#> 8 8 9 +#> 9 9 3 +#> 10 10 1 +#> 11 11 1 +#> 12 12 1 +#> 13 13 1 ``` - - ### Inference Let’s look at the following example where we estimate the log-likelihood