Skip to content

Commit

Permalink
Automatic readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 21, 2024
1 parent 93d9364 commit 48f3cb4
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ with `summary()`. Running `summary()` on the output of

Objects returned from `simulate_chains()` can be aggregated into a
`<data.frame>` 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 `<epichains>` object can be plotted in various ways using
`plot()`. See the plotting section in `vignette("epichains")` for two
use cases.

### Simulation

Expand All @@ -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)
Expand Down Expand Up @@ -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
```

<img src="man/figures/README-simulate_chains-1.png" width="100%" />

### Inference

Let’s look at the following example where we estimate the log-likelihood
Expand Down

0 comments on commit 48f3cb4

Please sign in to comment.