Define a function to be passed to the fn_values
argument of calibrate_model()
.
define_calibration_fn( type, strategy_names, element_names, cycles, groups = NULL, aggreg_fn = sum )
type | Type of model values ( |
---|---|
strategy_names | Names of strategies. |
element_names | Names of states (for counts) or of state values (for values). |
cycles | Cycles of interest. |
groups | Optional grouping of values (values in a
same group have the same |
aggreg_fn | A function to aggregate values in a same group. |
A numeric vector.
#> #> rn_mdl> # running a single model #> rn_mdl> #> rn_mdl> mod1 <- #> rn_mdl+ define_strategy( #> rn_mdl+ transition = define_transition( #> rn_mdl+ .5, .5, #> rn_mdl+ .1, .9 #> rn_mdl+ ), #> rn_mdl+ define_state( #> rn_mdl+ cost = 543, #> rn_mdl+ ly = 1 #> rn_mdl+ ), #> rn_mdl+ define_state( #> rn_mdl+ cost = 432, #> rn_mdl+ ly = 1 #> rn_mdl+ ) #> rn_mdl+ )#>#>#> #> rn_mdl> res <- run_model( #> rn_mdl+ mod1, #> rn_mdl+ init = c(100, 0), #> rn_mdl+ cycles = 2, #> rn_mdl+ cost = cost, #> rn_mdl+ effect = ly #> rn_mdl+ )#>#> #> rn_mdl> # running several models #> rn_mdl> mod2 <- #> rn_mdl+ define_strategy( #> rn_mdl+ transition = define_transition( #> rn_mdl+ .5, .5, #> rn_mdl+ .1, .9 #> rn_mdl+ ), #> rn_mdl+ define_state( #> rn_mdl+ cost = 789, #> rn_mdl+ ly = 1 #> rn_mdl+ ), #> rn_mdl+ define_state( #> rn_mdl+ cost = 456, #> rn_mdl+ ly = 1 #> rn_mdl+ ) #> rn_mdl+ #> rn_mdl+ )#>#>#> #> rn_mdl> res2 <- run_model( #> rn_mdl+ mod1, mod2, #> rn_mdl+ init = c(100, 0), #> rn_mdl+ cycles = 10, #> rn_mdl+ cost = cost, #> rn_mdl+ effect = ly #> rn_mdl+ )#>