Replies: 1 comment 2 replies
-
|
If you can define custom summaries with everything you need from the models, it would probably be best to go with |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the case of multiple Stan programs
model1.stan,model2.stan, .... passed totar_stan_mcmc(), what's the ideal way to define downstream targets for each of these models? For instance, let's say I have a functionmy_summary_fn()that I want to apply across all MCMC objects (for concreteness, this function could do some posterior predictive checks or generate some figures).So far I have three ideas, but I suspect there's a better way.
Idea 1: naively define targets using the generated target names
In the two model case this would look something like this:
This works but is not DRY and would be hard to scale for many models.
Idea 2: combine MCMC targets manually based on generated names
Another approach would define a new downstream target that combines the MCMC targets from each model:
This also works, but requires manually specifying the names of the generated mcmc objects (
example_mcmc_model1,example_mcmc_model2, ...), which doesn't seem ideal. I suspect there's a more programmatic way to do this that I'm missing.Idea 3: create a target factory
I haven't tried this yet, but maybe this is a use case for a custom target factory that adds downstream targets to the factory that
tar_stan_mcmc()produces.Is there a smarter way to refer to the set of mcmc targets that result from using multiple models in
tar_stan_mcmc()?Beta Was this translation helpful? Give feedback.
All reactions