Skip to content

Commit

Permalink
Split simulated data up across many stages
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed May 16, 2024
1 parent ff1ce29 commit d68c3c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ sdlog <- 0.5
obs_time <- 25
sample_size <- 200

sim_obs <- simulate_gillespie() |>
obs <- simulate_gillespie() |>
simulate_secondary(
meanlog = meanlog,
sdlog = sdlog
) |>
observe_process() |>
filter_obs_by_obs_time(obs_time = obs_time) %>%
.[sample(seq_len(.N), sample_size, replace = FALSE)]
)

obs_cens <- observe_process(obs)

obs_cens_trunc <- filter_obs_by_stime(obs_cens, obs_time = obs_time)

obs_cens_trunc_samp <- obs_cens_trunc[sample(seq_len(.N), sample_size, replace = FALSE)]

0 comments on commit d68c3c6

Please sign in to comment.