Model: Model class

Description Usage Arguments Format Construction Active field Public fields Public Methods Examples

Description

A container for the supported model objects (see SupportedTransitionModels). When a model object is stored inside Model it can be assess using reference semantics. This is particularly useful when you want to store model objects inside World. By doing so, you can assess those models from World as it is flowing down a microsimulation pipeline just like Entities.

Usage

1
2
## S3 method for class 'Model'
summary(object, ...)

Arguments

object

a Model object

...

dots

Format

R6::R6Class object inheriting Generic.

Construction

1
x <- Model$new(x, name = NULL, preprocessing_fn = NULL)

Active field

Public fields

Public Methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
simple_prob_model <- Model$new(x = list(yes = 0.95, no = 0.05))

simple_glm_model <- Model$new(x = stats::glm(factor(sex) ~ age,
  data = toy_individuals, family = "binomial"
))

# return the original model object
simple_prob_model$model

# add to world
world <- World$new()

world$add(simple_prob_model, name = "simple_prob_model")
world$add(simple_glm_model, name = "simple_glm_model")

# to access
world$get("simple_prob_model")
world$get("simple_glm_model")

# or alternatively you can use `get_model` which makes sure that it only looks
# through the named list of stored Model objects inside [World].
world$get_model("simple_prob_model")
world$get_model("simple_glm_model")

dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.