View source: R/vpc-simulation.R
new_sim_model | R Documentation |
Create a simulation model object from an existing model
new_sim_model(
.mod,
n = 200,
seed = 1234,
data = NULL,
sim_cols = c("DV", "PRED"),
gitignore_sim = getOption("bbr.gitignore_sim"),
.join_col = "NUM",
.sim_dir = get_output_dir(.mod),
.inherit_tags = TRUE,
.overwrite = FALSE
)
make_sim_spec(.sim, sim_args, .overwrite = FALSE)
.mod |
a |
n |
Number of simulations/subproblems. Adds |
seed |
A seed for simulation. Appended to |
data |
A dataset to simulate from. Defaults to |
sim_cols |
Character column name(s) defining the simulated values to table out. |
gitignore_sim |
If |
.join_col |
Character column name(s) used to join table files post
execution. Gets appended to the generated |
.sim_dir |
A directory for holding the new simulation model. Defaults to
the output directory of |
.inherit_tags |
If |
.overwrite |
If |
.sim |
a |
sim_args |
named list defining the |
S3 object of class bbi_nmsim_model
.
make_sim_spec()
: Store simulation run details in a specification
file before submission, which is stored in the output directory of the parent
model.
## Not run:
# Create new `nmsim` model object
.sim <- new_sim_model(
.mod,
n = 500, seed = 1234,
.join_col = c("NUM", "ID")
)
# Store run details in specification file
# - this is why these functions aren't exported
make_sim_spec(
.sim,
sim_args = list(n = 500, seed = 1234),
.join_col = c("NUM", "ID")
)
# Visualize changes
model_diff(.sim)
# Submit
submit_model(.sim)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.