Skip to main content

SubgroupSampleScenario

Robotics scenarios · Implementation: mlsysim/engine/scenario_definitions/robotics/supervision.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

An evaluation set of total people with a group of small_share, both detected at recall: exact intervals for each group, and the people per group a two-sided test at significance with power needs to tell rate_a from rate_b.

Notes

Equation: Group counts are rounded shares of total; recall intervals use exact binomial tails, while group-size planning uses a pooled normal approximation.

Assumptions: People are independent Bernoulli observations; assumed recall is converted to an integer success count by rounding.

Excludes: A study-design correction for correlated people, repeated measurements, or multiple subgroup comparisons.

References

Derivation: the scenario composes mlsysim.physics.statistics.calc_clopper_pearson_interval, mlsysim.physics.statistics.calc_two_proportion_sample_size. Their contracts supply the underlying equations; property equations show the remaining unit conversions and accounting.

Examples

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.PedestrianGroupEvaluationSample
>>> value = scenario.small
>>> round(float(value), 3)
200.0

Attributes

Name Description
confidence
large Remaining people after subtracting the rounded smaller subgroup count.
large_interval Dimensionless exact binomial recall interval for the larger group.
per_group_needed Ceiling of the pooled two-proportion planning approximation at the declared significance
power
rate_a
rate_b
recall
share_needed Required per-group sample count as a fraction of the current total evaluation count.
significance
small Rounded people count in the smaller subgroup, from total count times subgroup share.
small_interval Dimensionless exact binomial recall interval for the smaller group.
small_share
total
width_ratio Small-group interval width divided by large-group width, dimensionless.

Methods

Name Description
interval Clopper-Pearson recall interval for n observations and a rounded assumed success

interval

engine.scenario_types.SubgroupSampleScenario.interval(n)

Clopper-Pearson recall interval for n observations and a rounded assumed success count.

Equation: calc_clopper_pearson_interval(round(recall * n), n, confidence).

total

Type: int.

Declared default: required.

small_share

Type: float.

Declared default: required.

recall

Type: float.

Declared default: required.

rate_a

Type: float.

Declared default: required.

rate_b

Type: float.

Declared default: required.

significance

Type: float.

Declared default: required.

power

Type: float.

Declared default: required.

confidence

Type: float.

Declared default: 0.95.

small

engine.scenario_types.SubgroupSampleScenario.small

Rounded people count in the smaller subgroup, from total count times subgroup share.

Equation: round(total * small_share).

large

engine.scenario_types.SubgroupSampleScenario.large

Remaining people after subtracting the rounded smaller subgroup count.

Equation: total - small.

small_interval

engine.scenario_types.SubgroupSampleScenario.small_interval

Dimensionless exact binomial recall interval for the smaller group.

Equation: interval(small).

large_interval

engine.scenario_types.SubgroupSampleScenario.large_interval

Dimensionless exact binomial recall interval for the larger group.

Equation: interval(large).

width_ratio

engine.scenario_types.SubgroupSampleScenario.width_ratio

Small-group interval width divided by large-group width, dimensionless.

Equation: (b - a) / (d - c).

per_group_needed

engine.scenario_types.SubgroupSampleScenario.per_group_needed

Ceiling of the pooled two-proportion planning approximation at the declared significance and power.

Equation: _math.ceil(calc_two_proportion_sample_size(lo, hi - lo, float(norm.ppf(1 - significance / 2)), float(norm.ppf(power)), pooled=True)).

share_needed

engine.scenario_types.SubgroupSampleScenario.share_needed

Required per-group sample count as a fraction of the current total evaluation count.

Equation: per_group_needed / total.

Back to top