replicates: Function for running replicates of simulation.

Description Usage Arguments

View source: R/replicates.R

Description

Function for running replicates of simulation.

Usage

1
2
3
4
replicates(functions = new.env(), data = new.env(),
  data_transformations = quote({ }), simulation = quote({ }),
  generated_quantities = quote({ }), parameters = list(),
  control = list(), sandbox = TRUE)

Arguments

functions

An environment (could be coerced from a list) with any additional functions needed by the simulation.

data

An environment (could be coerced from a list) with all immutable data for the simulation. It may include code snippets (e.g.-quote(a <- 3; o <- f(x)))

data_transformations

code snippet run once, created by quoting a bracketed expression, (e.g.-quote(a <- 3; b <- 3*a)), which will be used to transform data once prior to simulation.

simulation

function defining a single simulation, taking 'parameters' as arguments.

parameters

list of lists. Each element is a list of parameter values..

control

control list for generating replicates, includes elements: 1) size, the number of replicates to generate per parameter set; 2) output, a snippet run at the end of each simulation, should persist results. used to summarize and persist simulation results.

sandbox

if TRUE the parent.env where the call is made will not be available to the code. For full effects see ?create_sandbox.

simulation

A code snippet, run once per replicate, created by quoting a bracketed expression, (e.g.-quote(a <- 3; b <- -1*a), which will be used to generate simulation output. This code can not modify the data.


sakrejda/simachine documentation built on May 29, 2019, 1 p.m.