Skip to content

Varying a data-generation parameter during SBC #29

Closed Answered by wlandau
mike-lawrence asked this question in Help
Discussion options

You must be logged in to vote

If I understand correctly, you want to generate multiple datasets with different values of N and have tar_stan_mcmc_rep_summary() output for both, right? I believe you can accomplish this with static branching via tarchetypes::tar_map(). Sketch:

# _targets.R
library(targets)
library(tarchetypes)
library(stantargets)
list(
  tar_map(
    values = list(N = c(100, 500, 1000),
    tar_stan_mcmc_rep_summary(x, data = generate_data(N = N), ...)
  )
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mike-lawrence
Comment options

Answer selected by mike-lawrence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants