createSimenv: Create new simenv object Simenv object - a simulation...

createSimenvR Documentation

Create new simenv object Simenv object - a simulation environment.

Description

A simulation environment contains everything required to perform a simulation. Typically 1 Simenv will be created and used to run a base simulation, and additional Simenvs will be created to test different scenarios.

Usage

createSimenv(
  name,
  simframe,
  dict,
  modulesName,
  cat.adjustments = list(),
  modules = list()
)

Arguments

name

simulation name

simframe

simframe

dict

a Dictionary object

cat.adjustments

Categorical variable adjustment matrices.

Each element is an adjustment matrix:

Non-smoker ( Year 1 NA NA Year 2 NA NA attr(,"varnames") [1] "z1msmokeLvl0" "z1msmokeLvl1"

The values in the first row are used to make adjustments before the simulation begins. Values in subsequent rows can be used during the simulation to set the required proportion during the specified iteration (eg: iteration 2 if a value is specified in Year 2). The variables in the simframe to adjust are specified by the varnames attribute.

modules

the list of Simmodules for this Simenv

cont.adjustments

A list of time-variant continuous variable adjustment matrices.

Each element is an adjustment matrix with number of rows equal to the number of micro units amd number of columns equal to the number of iterations plus 1 (for the presimulation adjustments).

The user specifies from the user interface desired increments (or decrements) for all micro units in particular categories (e.g. decrease the number of cigarettes smoked per day by 20 for every child with a mother who smokes 40 or more cigarettes a day), these adjustments are made to the simulated data from the base simulation and results stored in these matrices. At each year in the simulation these cont.adjustment matrices are checked and, if they contain values, they are used instead of the simulated values at that year.

Details

A Simenv consists of a: - a simframe (possibly with adjustments to test a scenario) - one or more simulation modules (Simmodule). A Simmodule contains outcomes, run stats, and runs.averaged for a simulation as well as the code to generate them.

Uses the global environment list variable "propensities" when performing categorical adjustment

This class will be subclassed by specific simulation problems which will provide their own simframe, Simmodules and adjustments.


kcha193/simarioV2 documentation built on April 8, 2024, 4:51 p.m.