
Summarise the parameter values of a calibration
Source:R/calibration_summary.R
summarise_calibration.RdSummarises, for every parameter value of a calibration table, the values tried by the calibration runs: what the best runs agree on, which parameters are pushed against their bounds, where the runs that failed went, and how the values moved from one generation to the next.
Usage
summarise_calibration(
runs,
calib_table,
n_best = 5,
n_top = 20,
relative = NULL,
bound_tol = 0.01
)Arguments
- runs
The runs: a data frame as returned by
read_calibration_runs(), or the folder to read them from.- calib_table
The calibration table of the runs, as returned by
generate_calibration_table().- n_best
Number of best runs whose range is given.
- n_top
Number of best runs whose median, and the number at a bound, are given.
- relative
Report the parameters as factors of their starting value?
NULL(default) to decide per parameter as described above,TRUEorFALSEfor all, or one value per row ofcalib_table.- bound_tol
A value counts as at a bound when it is closer to it than this fraction of the search range (calibration scale).
Value
A list of three data frames:
parameters: one row per row ofcalib_tablewithname,position,start(starting value),scale("factor"or"value"),best(best run),lowandhigh(range of then_bestbest runs),median(median of then_topbest runs),at_bound(number of then_topbest runs at a bound) andfailed_shift(mean value of the failed runs minus that of the completed runs, calibration scale;NAwithout failed runs);generations: per generation and parameter, themedianof then_bestbest completed runs of the generation, on the scale ofparameters;scores: per generation, the number ofruns, offailedruns, and thebestandmedianscores of the completed runs.
The runs without generation make the generation NA.
Details
The runs are ranked by score among those that completed. The values are
reported on the model scale, either as they are ("value") or as a factor
of the starting value (cur_value of calib_table, "factor"). By
default, a parameter is reported as a factor when its starting value lies
within its bounds, and as a value otherwise (e.g. a rate started at a
placeholder 1e-12 below its search range). The statistics are computed
on the calibration scale and then mapped to the model scale.
See also
read_calibration_runs(), apply_parameters() to apply the
values of a run.
Examples
if (FALSE) { # \dontrun{
tbl <- generate_calibration_table(mod, "calibration.yaml")
res <- summarise_calibration("calibration_results", tbl)
res$parameters
} # }