Calibrate the Per-task Cost Model on the Current Machine
Source:R/cost-estimate.R
ssd_calibrate_cost.RdRuns a small, fixed benchmark sweep on the current architecture - tiny
nboot values, all ssdtools::ssd_ci_methods(), and a couple of nrow
values - times each ssdtools::ssd_hc() call, fits the per-ci_method cost
model time = (base + slope * max(nboot, n0)) * nrow_factor(nrow), and returns
a versioned ssdsims_cost_calibration object carrying the fitted coefficients
and provenance. Producing an architecture-specific estimator is nothing more
than this single call plus passing the result to ssd_estimate_cost().
Arguments
- nboot
An integer vector of tiny bootstrap sizes to sweep (the slope and floor are fit over these).
- nrow
An integer vector of at least two sample sizes to fit one model per (the
nrow_factoris derived from these).- data
A reference data frame with a numeric
Conccolumn to resample (defaultssddata::ccme_boron).- seed
A whole number seeding the resampling so the sweep is reproducible.
Value
An ssdsims_cost_calibration object with per-ci_method
base/slope/n0 coefficients, a bounded nrow_factor, a fixed_addend,
and provenance (cpu, R version, ssdtools version, date, sweep grid).
Details
The sweep is self-contained and dependency-light: it draws data by resampling
a reference dataset (ssddata::ccme_boron by default) and times with base
system.time(). It takes minutes - not the hours a real scenario costs -
because the nboot values are tiny (the slope and floor are estimable from
small bootstraps). The one-time research that discovered the model's form
(which axes are free, the max(nboot, n0) shape, the non-monotonic nrow
factor) is preserved under the change's exploration/ directory; it is not
rerun here.
See also
ssd_cost_calibration() for the shipped default and
ssd_estimate_cost() to apply the result.