egta.bootstrap module¶
module for bootstrapping regret and surplus
-
egta.bootstrap.
deviation_payoffs
(sched, mix, num, *, boots=0, chunk_size=None)[source]¶ Bootstrap deviation payoffs
Parameters: - prof_sched (Scheduler) – The scheduler to sample profiles from.
- mix (ndarray) – The mixture to calculate the regret of.
- num (int) – The number of samples to gather. Must be positive.
- boots (int, optional) – The number of bootstrap samples to take. The accuracy of bootstrap is independent of this number, but more will reduce the variance of the underlying confidence bounds. The default will compute no bootstrap gains.
- chunk_size (int, optional) – An implementation detail specifying how frequently profiles are scheduled since this algorithm inherently operates in a streaming manner. Ideally this number should be set such that the time to schedule and process chunk_size roughly equals the time for one simulation. It also controls how much memory this uses. By default this is set to ten times the number of bootstraps, or 1000 if no bootstraps are requested.
Notes
This uses memory on the order of boots + chunk_size. It is inefficient if num is less than boots.
Returns: - mean_gains (ndarray (num_strats,)) – The mean deviation payoffs from the mixture.
- boot_gains (ndarray (boots, num_strats)) – The deviation payoffs for each bootstrap sample.