DetectionDelayLossScenario
Statistics scenarios · Implementation: mlsysim/engine/scenario_definitions/statistics.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
A fault that cuts quality_drop of annual_value until it is detected, found after slow_detection or fast_detection, incidents_per_year times a year.
Notes
Equation: Loss is annual value times quality drop times the fraction of a year spent undetected; incident frequency scales savings.
Assumptions: Value accrues uniformly and each incident has the same constant quality loss.
Excludes: Compounding, overlapping incidents, recovery costs, and uncertainty in the declared annual value.
References
Derivation: the scenario composes mlsysim.physics.economics.calc_detection_delay_loss. Their contracts supply the underlying equations; property equations show the remaining unit conversions and accounting.
Examples
>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RecommenderDetectionDelayLoss
>>> value = scenario.slow_loss
>>> str(value.units)
'USD'Attributes
| Name | Description |
|---|---|
| annual_savings | Expected USD saved in a year at the supplied incident frequency. |
| annual_value | |
| fast_detection | |
| fast_loss | Per-incident USD loss under the faster detection duration. |
| full_year_loss | USD lost if the quality drop persisted for an entire year. |
| incidents_per_year | |
| quality_drop | |
| savings_per_incident | Slow minus fast loss, in USD per incident. |
| slow_detection | |
| slow_loss | Per-incident USD loss under the slower detection duration. |
| slow_over_fast | Ratio of slow-detection to nonzero fast-detection loss, dimensionless. |
Methods
| Name | Description |
|---|---|
| loss | USD lost while the fault persists for delay under a constant value-loss rate. |
loss
engine.scenario_types.DetectionDelayLossScenario.loss(delay)USD lost while the fault persists for delay under a constant value-loss rate.
Equation: calc_detection_delay_loss(annual_value, quality_drop, delay).to('USD').
annual_value
Type: Quantity.
Declared default: required.
quality_drop
Type: float.
Declared default: required.
slow_detection
Type: Quantity.
Declared default: required.
fast_detection
Type: Quantity.
Declared default: required.
incidents_per_year
Type: float.
Declared default: required.
slow_loss
engine.scenario_types.DetectionDelayLossScenario.slow_loss
Per-incident USD loss under the slower detection duration.
Equation: loss(slow_detection).
fast_loss
engine.scenario_types.DetectionDelayLossScenario.fast_loss
Per-incident USD loss under the faster detection duration.
Equation: loss(fast_detection).
savings_per_incident
engine.scenario_types.DetectionDelayLossScenario.savings_per_incident
Slow minus fast loss, in USD per incident.
Equation: slow_loss - fast_loss.
annual_savings
engine.scenario_types.DetectionDelayLossScenario.annual_savings
Expected USD saved in a year at the supplied incident frequency.
Equation: (savings_per_incident * incidents_per_year).to('USD').
full_year_loss
engine.scenario_types.DetectionDelayLossScenario.full_year_loss
USD lost if the quality drop persisted for an entire year.
Equation: (annual_value * quality_drop).to('USD').
slow_over_fast
engine.scenario_types.DetectionDelayLossScenario.slow_over_fast
Ratio of slow-detection to nonzero fast-detection loss, dimensionless.
Equation: (slow_loss / fast_loss).to('').magnitude.